Applescript: close app after 1 minute???

Hello!

I am using this script: (made by: http://www.technocrat.ca/?p=44)


tell application “iSync”
if last sync is less than ((current date) - 900) then
synchronize
end if
end tell

I want to quit iSync after synchronize, how can I do it?
I’ve tried with “quit application “iSync”” but doesn’t work because it tries to quit isync before the sync starts.

Hi and welcome,

iSync has a property syncing, which is true during sync

tell application "iSync"
	if last sync is less than ((current date) - 900) then
		synchronize
		delay 5
		repeat while syncing is true
			delay 1
		end repeat
		quit
	end if
end tell