i am using a script to keep my address book connected to my bluetooth phone and sync with isync at regular intervals. works like a charm except i’d like it to run in the background. NOT to launch and then hide itself but never to be visible in the first place. i searched these forums extensively and only found how to hide apps once they are running.
here’s the script in it’s current form:
tell application "Address Book"
if not unsaved then
try
quit
delay 1
end try
end if
end tell
-- Reconnect to the Address Book
do shell script "defaults write com.apple.AddressBook ABCheckForPhoneNextTime -boolean true"
try
tell application "Address Book"
launch
end tell
tell application "System Events"
set the visible of process "Address Book" to no
end tell
end try
-- Synchronize the Device
tell application "iSync"
if last sync is less than ((current date) - 420) then
synchronize
end if
end tell
tell application "System Events" to set visible of process "iSync" to false
note that i saved as an application. perhaps i should save as just a script? note also that i put this code at the beginning, and it did indeed hide the script, but only AFTER it briefly activates, hijacking whatever else i happen to be working on.
tell application "System Events"
keystroke "h" using command down
end tell
i’m looking for a way to have it run silently in the backround.
thanks!
Model: macbook pro
AppleScript: 1.10.7
Browser: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.0.10) Gecko/20070228 Camino/1.0.4
Operating System: Mac OS X (10.4)