Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Full strength script here!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Full strength script here!
Authored by: pairof9s on Nov 26, '03 07:49:36AM
After much work by Graf (another poster in this thread), the following script provides the ability to perform the My Card change in Address Book, sync w/ iSync, and then quit the applications. Set up the script to run via Cronnix and you now have an automatic means of performing the tasks.

Note: Be sure and save the script as an application and check the "Stay Open" option. Set Cronnix to run the script on the "Minute" you desire; set the others (Hour, Day, etc.) to the "Any" setting. Browse to your script's location and save.

global CurrentMyCard
global aBookRun
global iSyncRun
global isSynching

on idle
	try
		if isSynching is true then
			tell application "iSync" to set isSynching to syncing
			if isSynching is false then
				try
					tell application "Address Book"
						set NewCurrentMyCard to my card
						if NewCurrentMyCard is not CurrentMyCard then
							set my card to CurrentMyCard
							save addressbook
						end if
					end tell
				on error
					display dialog "An error occurred when attempting to set \"My Card\" in Address Book"
				end try
				try
					if aBookRun is false then tell application "Address Book" to quit
					if iSyncRun is false then tell application "iSync" to quit
					quit
				on error
					display dialog "An error occured when attempting to quit Address Book and iSync."
					quit
				end try
			end if
		end if
	on error
		display dialog "An Error occurred in the Idle Handler."
		quit
	end try
	return 1
end idle

on run
	try
		tell application "Finder"
			set aBookRun to (name of processes) contains "Address Book"
			set iSyncRun to (name of processes) contains "iSync"
		end tell
		tell application "Address Book" to set CurrentMyCard to my card
		tell application "iSync" to synchronize
		set isSynching to true
	on error
		display dialog "An Error occurred in the Run Handler."
		quit
	end try
	idle
end run


You can also download the script from my Homepage:
http://homepage.mac.com/pairof9s/FileSharing2.html

[ Reply to This | # ]