How do I select the output format in the Save As dialog of Mail.app? I know how to change the file name by using keystroke
but I could not figure out how to change the file format in AppleScript.
Select the save format in the Save As dialog by using AppleScript
applescript
Related Question
- Select a menu item of a window instead of a process using Applescript
- AppleScript choose file dialog box with default location not working
- Use Applescript/Automator to select a window highlighted in the Finder
- AppleScript Save As Dialog in Safari Reader Save As PDF
- Detect application focus event using applescript
- MacOS – Output format of the standard Mac OS Color Picker dialog (choose color)
- AppleScript to save current Safari window in webarchive format
- AppleScript basic date/time format and filename
Best Answer
Assuming Mail has focus and the Save As sheet is showing, then the following example AppleScript code would click the Format: pop up menu and select e.g.: Plain Text
You can also use the menu item number, e.g.
click menu item 3 of menu 1
Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g.
delay 0.5
, with the value of the delay set appropriately.