Can Mac Preview be set to default to save image as JPEG
Preview defaults to saving as PNG. I can change PNG to JPEG, but I have to do it every time.
Is there a way to change the default behaviour?
Is there a way to change the default save/export format in Preview? basically doesn't answer the question, but says that Preview saves it in the form it came in. Well, sort of. If I'm browsing google images, and right-click copy image, even though it's a jpeg image originally, when you past as new selection, it will default to save as PNG.
How can the default save format be changed for OS X Preview app? gives two solutions for someone who wants to save as PDF -- one using a python script, and two using a shortcut key mapped to export as PDF.
Neither of these solutions is workable.
A: In many cases I have a bunch of intermediate steps, editing the image in Preview. Most images will have a crop, a resize, and an annotate. I suppose in principle the python script could be modified to save the current buffer in preview as a jpeg after I've done the others, but I don't yet speak python.
B: The command shortcut doesn't work, as there is no menu command for "Save as JPEG" Instead the Save menu item opens a modal dialog that requires the input of a name (since New->From Clipboard makes a file with the name "untitled-N") and every time a click on the ribbon control at the bottom of the dialog box to move to JPEG
Solution 1:
No easy preference or key is known to change the defaults. Barring a new discovery, plan to use a different app or script image conversion with automation.
You probably already know you could make a keyboard shortcut if an Apple menu to save as JPEG existed, but that’s the crux here. Other questions here have useful details on automation and using python to process the clipboard instead of preview.
- Is there a way to change the default save/export format in Preview?
- How can the default save format be changed for OS X Preview app?
Solution 2:
As a workaround, the following example AppleScript code, shown further below, will do a Save As… and select JPEG and can be used in an Automator Service with a Run AppleScript action and a keyboard shortcut assigned to it in: System Preferences > Keyboard > Shortcuts > Services
For testing purposes, in macOS High Sierra, I used: ⇧⌘J
NOTE: This may also require giving Preview accessibility privileges for this to work properly.
tell application "Preview" to activate
tell application "System Events" to tell application process "Preview"
click menu item "Save As…" of menu "File" of menu bar item "File" of menu bar 1
click pop up button 2 of sheet 1 of window 1
click menu item "JPEG" of menu 1 of pop up button 2 of sheet 1 of window 1
set value of value indicator 1 of slider 1 of sheet 1 of window 1 to 0.9
click button "Save" of sheet 1 of window 1
end tell
• The value
of value indicator 1
is a decimal value from 0.0
to 1.0
.
• You may need to use some delay
commands, e.g. delay 0.2
between lines as needed.
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.