When I set up a macro to executee a script, how do I then do something in Keyboard Maestro based on the result of that script?
For example, I am writing a script to test if the front-most application is in full screen mode, and if it is, to intercept the escape key. If it is not, then I’d like the escape key to be pressed.
I have the following script set to execute, but short of actually doing the keypress in the script, how do I tell KM “Do this is script returns false and do the other thing if it returns true”?
try
tell application "System Events"
tell (first application process whose frontmost is true)
tell (first window whose subrole is "AXStandardWindow")
set myFullscreen to value of attribute "AXFullScreen"
if myFullscreen then
-- return something
else
-- return something else
end if
end tell
end tell
end tell
end try