Tuesday, July 26, 2011

Switching back to the previous application with AppleScript

If you want to simulate cmd + tab with AppleScript, here it is

tell application "System Events"
tell process "finder"
activate
keystroke tab using {command down}
end tell
end tell


You can use the same thing in bash

echo 'tell application "System Events"
tell process "finder"
activate
keystroke tab using {command down}
end tell
end tell' | osascript

No comments:

Post a Comment