Saturday, November 07, 2009

Update to isync script

Back in February I delved into the shallow waters of Apple Script in an attempt to automate the process of synching my Nokia 'phone with iCal and Address Book.

Well this week I refined the script a little more having discovered how to quit a programme (tell "application" to quit, not exactly rocket science), and how to delay it so that it didn't generate an error by trying to quit before synchronisation was complete.

I also discovered along the way that you could tell your mac to inform you that the task was complete using one of the voices.

The finished script is as follows:

tell application "iSync"

if last sync is less than ((current date) - 3600) then

synchronize

repeat while (syncing is true)

delay 5

end repeat

end if

end tell

tell application "iSync" to quit


say "synchronisation is now complete. Have a good day" using "Zarvox"


You can add a line that hides isync if you want, but it's not that important.

No comments: