Hi, all. I’m wondering if there is some way to trigger a dot.mac sync from AppleScript. I know I can sync with iSync, but the dot.mac sync was moved to a preference pane in recent versions. I’ve dug around various dictionaries, but I don’t see any way to trigger a sync other than via the prefPane or the menubar icon.
I don’t have dotMac, but it is possible to GUI script the System Preferences, so I know it’s doable, but can’t help you with how. I’m sure there’ll be an answer from someone who can test their script.
tell application "System Preferences"
activate
reveal anchor "sync" of pane id "com.apple.preference.internet"
end tell
tell application "System Events"
tell process "System Preferences"
repeat until exists window ".Mac"
delay 0.5
end repeat
tell button 1 of tab group 1 of window ".Mac"
repeat until enabled
delay 0.5
end repeat
perform action "AXPress"
end tell
delay 0.5
end tell
end tell
quit application "System Preferences"
scripting SystemUIServer (works best if the sync menu is as leftmost as possible)
tell application "System Events"
tell process "SystemUIServer"
repeat with mni in (get menu bar items of menu bar 1)
if (value of attribute "AXDescription" of mni as string) is "" then
perform action "AXPress" of mni
set NameList to name of menu items of menu of mni
if item 1 of item 1 of NameList begins with "Last .Mac" then
perform action "AXPress" of menu item "Sync Now" of menu of mni
exit repeat
end if
end if
end repeat
end tell
end tell