Hi everyone,
I have a script that’s nearly completed but has slightly one annoying element - it cannot identify and close a pop-up window only ONCE inside an idle block that ends with a return. To make matters worse this pop-up window doesn’t have an identifiable name (it’s simply part of the program the script is controlling). What I’m trying to avoid is using a repeat command (within the run block) since it consistently locks up on me and cannot exit after identifying application exists. For example, this is what I have thus far, which works but loops the key code 76 (enter) command:
property k_application : “Student Network Signin”
on run
– runs script during menu interface
end run
on idle
tell application “System Events” to process k_application exists
if result then
tell application “System Events”
key code 76
end tell
end if
– rest of idle block
return 2
end idle
The k_application is consistently active during idling so how else can I work this? I’m sure the repeat function can be tamed inside the run block, but how? Or is there a way to have a command within an idle block only run once? There doesn’t seem to be any other identifiable applications to trigger this action and make it an if/then instance.
Thank you,
Antnee