Вопрос

Normally in AppleScript it goes line by line and at the end it quits the script. Is there a way to make the script keep on running? This is the situation:

Via the AppleScript I am opening Google Chrome. This is fine. After opening it the AppleScript have to keep on running until Google Chrome is closed. When closed it needs to show a dialog that Google Chrome is closed and quit itself.

Is there a way to do this?

Это было полезно?

Решение

You can also try an on idle handler...

repeat until application "Google Chrome" is not running
    -- insert your code
    say "run"
    delay 2
end repeat
say "quit"
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top