tell application "System Events"
click button 1 of window "Select an Option" of application process "CafeTran" of application "System Events"
delay 0.5
click button 1 of window "Message" of application process "CafeTran" of application "System Events"
end tell
This works in the AppleScript editor and when I run the embedding action in the KM macro. However, it doesn't work when I run the whole macro:
tell application "System Events"
tell process "CafeTran"
set frontmost to true
key code 119 using {control down, option down} -- control-option-end
end tell
delay 0.5
click button 1 of window "Select an Option" of application process "CafeTran" of application "System Events"
delay 0.5
click button 1 of window "Message" of application process "CafeTran" of application "System Events"
end tell
Always nice to find our own solution! Just an FYI, you ca simplify your AppleScript. Right now you have superfluous tell commands. See my example below.
tell application "System Events" to tell application process "CafeTran"
set frontmost to true
key code 119 using {control down, option down} -- control-option-end
delay 0.5
click button 1 of window "Select an Option"
delay 0.5
click button 1 of window "Message"
end tell