make script run in background?

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)

Have a look at James Sentman’s “Drop Script Backgrounder”

drop script backgrounder is SWEET. thanks for that. HOWEVER, fyi, when i have the the script run by setting it to run as a cron job (i used the handy app Cronnix) both the address book and isync still come to the forefront. when, on the other hand, i set it as a script to run as an alarm in ical, it does so silently in the background. a curious behavior but not one i’m overly worried about. i’ll just make a boatload of ical events to make it run periodically. (unless someone knows how to fix the issue)

thanks for your help!

update: i have deleted all the ical event alarms i made for this script, since, for every time they do not run (due to the phone being out of range or the computer off), ical puts up a warning window saying the script could not execute. and when i made them for every ten minutes, that’s a LOT of windows to wait for. yuck. so, still looking for a solution.

anyone? thanks.