Application and Time Parameters in Pause While statement

(imported topic written by RichB91)

With thanks to

boyd

and

cstoneba

on the

6008

thread, I know I can wait for a program to close

OR

a timer to expire, whichever comes first, by using:

pause while {(exists running application “calc.exe”) AND (now-time(parameter “TimerStart”) < 15*second)}

But I want to use parameter for both the application and the time delay and haven’t been having any luck. I tried:

parameter “ProgramToWatch” = “calc.exe”

parameter “SecondsToWait” = “15”

parameter “TimerStart” = “{now}”

pause while {(exists running application {parameter “ProgramToWatch”}) AND (now-time(parameter “TimerStart”) < {parameter “SecondsToWait” as integer}*second)}

…but I get a ‘This expression contained a character which is not allowed’ error. I tried just changing the the application or the time section with a combination of () and {} all without scueess.

Any suggestions?

(imported comment written by NoahSalzman)

This seems to work:

parameter "ProgramToWatch" = "calc.exe"
parameter "SecondsToWait" = "15"
parameter "TimerStart" = "{now}"
 
pause while {(exists running application (parameter "ProgramToWatch")) AND (now-time(parameter "TimerStart") < (parameter "SecondsToWait" as integer)*second)}

You can’t put (un-escaped) curly braces inside curly braces in Action Script.

(imported comment written by RichB91)

Thank you! Works just like I had hoped.

I thought I had tried useing () already. Guess I just used {}.

Thanks again,

RichB