0

I wrote this to push on a button, and it's work fine when I run the script, however when I run the script from mail (trigger from a email rule) nothing happen.

Is this due to an Applescript limitation or am I doing something wrong?

try
    activate application "app"
on error
    delay 1
    activate application "app"
end try

delay 0.5

try
    tell application "System Events"
        tell process "app"
            click button 2 of window 1

        end tell
    end tell
on error
    --
end try
  • Just putting this here if you end up needing a debugger to look at the values of the variables in your AppleScript - latenightsw.com – bmike May 21 '18 at 12:19
  • Perhaps you can tell us what application is "app", as it is its button that you are trying to activate, or do what bmike suggests and get a high end script editor, like Script Debugger. – MBUST May 22 '18 at 13:49
  • it's an internal app , it's weirdly work very fine when the script is executed from the Script editor, anyway I will try to have some debug info and leave more details – Kevin May 25 '18 at 10:18

You must log in to answer this question.

Browse other questions tagged .