Automatically update Spotlight's currency converter

The currency converter in OS X Yosemite's Spotlight doesn't update exchange rates automatically. I've been calculating with 2012 data all this time. I cursed like an Irish milkman when I found out.

Kalmi came to the rescue with his instructions below on how you can manually update it from Terminal (instead of opening the Calculator app all the time). Here's my small addition on how to do that automatically, once a day.

Make a script with the commands below and save it as CurrencyUpdate.sh:

#!/bin/bash defaults delete com.apple.calculateframework currencyCache; defaults delete com.apple.calculateframework currencyCacheRefreshDate; osascript -e 'quit app "Spotlight"'; osascript -e 'activate app "Spotlight"';

Add this line to your crontab after adjusting the paths and filenames to your local needs:
(the nice way would be with launchd I guess but I don't know launchd)

0 10 * * * /Users/eszpee/Dropbox/symlinks/Scripts/CurrencyUpdate.sh >> /var/log/CurrencyUpdate/error.log 2>&1

This will update the currency data every morning at 10AM (assuming your computer is on).

Advertisement

Advertisement

Thanks Kalmi!