I'm trying to create a Quick Action with Automator (macOS 11.6.1, PixelMator Pro 2.2 from AppStore) for processing multiple selected images, but no luck so far
What I'm trying to achieve:
- Select multiple images in Finder (manually);
- Send them via Quick Action menu to 'Export for Web';
- Save in same folder, overwriting original files.
I always sort and duplicate files before editing, so a prompt for a save location or overwrite confirmation is really not necessary.
After going over Google and various topics on this board, I kind of managed to stich together some AppleScript code, but it doesn't really work:
tell application "Pixelmator Pro"
set exportLocation to choose folder with prompt "Please choose where you'd like to export the images:"
tell the front document
export for web format(PNG)
export for web options {compression factor:100, advanced compression:true, reduce colors:false, keep transparency:true, convert to sRGB:false, scale:1}
end tell
end tell
I don't know how to set location to current folder, so I've just copied that part from another script I've found here.My Automator settings are:
Workflow receives: Image files in Finder
The first thing on my Automator routine is Get Selected Finder Items, followed by Run AppleScript, as above.
I'm always getting error "Document 1 doesn't understand format message".
Any help or examples would be highly appreciated