Wednesday, November 20, 2019

#1 2019-10-15 01:59:30 pm

Schmitz
Member
Registered: 2019-10-14
Posts: 1

wav to m4a via quickaction

Dear friends,
I am trying to create a quick action (activated by right click) for WAV to m4a conversion process: I discovered that quicktime player has an option File->Export as-> Audio only...->

I want to imitate the clicks on the menu but cannot "click" on the "Audio only..." while File and Export as are "clickable" via Applescript.

This is the script I am trying to run - the line with "->" gives an error System Events got an error: Can’t get menu item "Audio only..." of menu item "Export as" of menu "File" of menu bar 1 of process "QuickTime Player".:

Applescript:

on run {input, parameters}
   
   tell application "System Events"
       tell process "QuickTime Player"
           set frontmost to true
           click menu "File" of menu bar 1
           click menu item "Export as" of menu "File" of menu bar 1
           -> click menu item "Audio only..." of menu item "Export as" of its menu "File" of menu bar 1
           
           
       end tell
   end tell
   
   return input
end run

I will highly appreciate any ideas regarding the general task and the error in particular.
Thanks smile

Offline

 

#2 2019-10-19 04:36:54 am

KniazidisR
Member
Registered: 2019-03-03
Posts: 720

Re: wav to m4a via quickaction

You were close to the target:

Applescript:


on run {input, parameters}
   tell application "System Events" to tell process "QuickTime Player"
       set frontmost to true
       click menu "File" of menu bar 1
       click menu item "Export as" of menu "File" of menu bar 1
       click menu item "Audio Only…" of menu "Export as" of menu item "Export as" of menu "File" of menu bar 1
   end tell
   return input
end run

Last edited by KniazidisR (2019-10-19 04:38:40 am)


Model: MacBook Pro
macOS Mojave -- version 10.14.4
Safari -- version 12.1
Firefox -- version 70.0

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)