How to use Automator to bring window to front?

青春壹個敷衍的年華 提交于 2019-12-04 09:32:49

Apple Script is the best way to go for things that don't require any "special processing" that would need to be done by a chain of different applications.

1) uging the AppleScript Utility make sure that you have GUI scripting enabled in the "AppleScript Utility" 2) using the Script Editor choose File>Open Library and see if your application has any scriptable functions ... these may be a better way to go.

3) Create a new script and put in something like this ...

tell application "Firefox"
    activate
    delay 1 -- give it time to react

    repeat 3 times
        -- this gives us the keyboard
        tell application "System Events" 
            keystroke "r" using {command down}
        end tell
        delay 6
    end repeat
end tell

I used Firefox to test it .... should work for you ....

Once you've got the script you can use the save as to make it into an app or save it as a script in your ~/Library/Scripts folder or paste it into an automator workflow and schedule it with iCal.

I don't think automator is the way to go. You could use applescript, but you should take a look at sikuli. You will need to write the Sikuli script yourself, but what you describe shouldn't be difficult

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!