Oh yes, another "repeat" question!

I am trying to check the status or a program

else
		tell application "FaceTime" to activate
		tell application "System Events" to tell process "FaceTime"
			if name of front window contains "with" then
				do shell script "sleep 1"

and add a repeat command, till the status changes, then it should do this:

 else
	if name of front window contains "facetime" then
		tell application "FaceTime" to quit
			do shell script "sleep 1"

[b]
But no matter where I add my repeat and end repeat commands, I can not get it to work
What am I doing wrong?

Thanks!

Jonathan[/b]

What does the script look like with the repeat in? I know it doesn’t work, but what did you write?

Hi there,
It doesn’t repeat, it still quits.

Here is the full script:
http://macscripter.net/viewtopic.php?id=36404

Thanks!
Jonathan

I figured it out,

:slight_smile:

I added in a “set status to true” (true/false) then a repeat until status = false
where the repeat command is about halfway in the code, I then check several statements and there result is either true of false, if the result is true, the program keeps repeating, once the status is false, the program ends, and does ‘end functions’

Suggestion, if you are going to use this, make sure you set a status to ‘true’ at the start of the program
just to make sure, that it has something to start with.

Jonathan

PS: As a cheat I used a “say” command ‘Say Status’ at each piece of code, to tell me which was true and false, it helped me in debugging and getting the log straight A LOT!