Applescript for quitting an application plus hitting it's pop up "quit" button?

I'm making an Automator application to quit "Wondershare AllMyMusic" after a 3-hr pause while it records.  I have a 3-hr "pause" action but can't use the "quit application" action because I get a "Do you want to quit?" pop up window with a "Don't Quit" white button and a "Quit" blue button that can be selected by hitting return.  I'm trying to run applescript to keystroke return or click "quit" button, but I know almost nothing about writing script.  I tried different scripts I found while searching the subject but nothing has worked yet.  Do you have any suggestions?


Automator Version 2.6 (419)


OS X 10.11.6


iMac, OS X El Capitan (10.11.6)
Has invited:

howapple - hello

Favor from:


Thanks for the quick reply Camelot!  I found a code that used command-q plus return together and it worked:

 

tell application "System Events"

    set frontmost of process "Wondershare AllMyMusic" to true

    keystroke "q" using command down

    keystroke return

end tell

 

I had tried similar code to the one you shared (and just tested yours) but for some reason these don't work.  This streaming audio recording app has many preference controls and other things it lacks.  It even lacks simple menu or key commands for the record, pause and play buttons (you can only mouse click) but the thing it does do, it does pretty well.

 

Thanks again for your reply!

To reply to a question, please Login or registered