How to repeat a script in the background

Hello!

I just want my script to repeat its task every 10 second as long as the script is lounched and open, or even better, in the background (if possible).
This is the script and it work very well…but only one time :slight_smile:


tell application "QuarkXPress Passport"
	tell document 1
		
		set theimagepaths to get file path of images as string
		set thedokumentname to get the name
		
	end tell
end tell

set the_file to "Macintosh HD:Users:louise:Desktop:images:" & thedokumentname & ".txt"
try
	open for access the_file with write permission
	set eof of the_file to 0
	write ("	
" & theexists & "
	
" & theimagepaths & "
	
" & thedokumentname & "
	
") to the_file starting at eof as list
	close access the_file
on error
	try
		close access the_file
	end try
end try

Try wrapping your script in an idle handler, lillagubben:

on idle
	
	(* your script here *)
	
	10 (* number of seconds to wait *)
end idle

…then save the script as a stay-open application.

The best in life is free…even if it’s just as a little text string :slight_smile:

Thanks man!!!