I'm trying to make my app quit itself by pushing a button. I could just connect the button to application with terminate, but then it wouldn't run the script it is attached to. I want something like this:
I want to know how to make the script tell the application it is controlling to quit. HELP!
Code:
tell window "main window"
set varact to contents of text field "action"
if varact is "beep"
beep
else
-- do nothing
end if
end tell
terminate myapp