Pixelmator Pro

How would I create a macro to take a list of pics and open in pixelmator Pro, straighten pics, the save and close pics in pixelmator Pro

If other people own that $70 app maybe they can help. But if you want me to help, a video would be needed. If you create a video, I might understand what you mean by "a list of files". Is that a list on a piece of paper, or a selection of files in the Finder, or a bunch of already opened files in Pixelmator Pro, or a list of paths in a variable, or something else. There are too many unknowns for me to help. I also don't know what you are clicking on to "straighten the pics."

I have Pixelmator Pro, and can say that opening a series of photos in is straightforward enough. So would the process of saving those pictures. The more complex part is the “straightening” you’re talking about. Can you expound on that? When I’m back at my computer tomorrow I can take a look at what some options might be.

Hi
under the crop option, next to ml crop there are three dots, then click on them you get the auto straighten command. Basically, I would like to select a folder of pics and perform this action on them, save and close the application, Pixelmator Pro

You may want to consider the batch mode for Pixelmator Pro. Here's the description.

https://www.pixelmator.com/tutorials/batch-process-images-using-the-automator-app-and-pixelmator-pro/

Hi
Thanks for the information, there are a lot of useful shortcuts but straitening is not on the list.

Okay, in that case I'll leave you to cdthomer, who has Pixelmator Pro, and who is a top notch wizard.

Here’s a basic AppleScript to select the Auto Straighten feature. (click to expand/collapse)
------------------------------------------------------------
# Author   : Chris Thomerson (@cdthomer)
#
# Version  : 1.0.0 (Initial script)
# History  : 1.0.0 (Initial script)
#
# Created  : Friday, October 27, 2023
# Modified : Friday, October 27, 2023
# macOS    : 13.6 (Ventura)
# Tags     : Pixelmator Pro, Image Editing, Cropping
#
# PURPOSE
# Use the auto-straighten feature
#
# DISCLAIMER
# Permission to use, copy, modify, and/or distribute this
# software for any purpose with or without fee is hereby
# granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
# USE OR PERFORMANCE OF THIS SOFTWARE.
------------------------------------------------------------

# bring PP to the front
tell application "Pixelmator Pro"
	activate
	repeat until frontmost is true
		delay 0.1
	end repeat
end tell

# use the auto-straighten feature
tell application "System Events"
	tell application process "Pixelmator Pro"
		
		# wait for the ML Crop ellipsis to appear
		repeat until exists menu button 1 of scroll area 1 of group 1 of group 2 of window 1
			delay 0.1
		end repeat
		
		# click the ML Crop ellipsis to appear
		click menu button 1 of scroll area 1 of group 1 of group 2 of window 1
		
		# wait for the Auto Straighten menu item to appear
		repeat until exists menu item 1 of menu 1 of menu button 1 of scroll area 1 of group 1 of group 2 of window 1
			delay 0.1
		end repeat
		
		# click the Auto Straighten menu item to appear
		click menu item 1 of menu 1 of menu button 1 of scroll area 1 of group 1 of group 2 of window 1
		
	end tell
end tell

For now, I’ll leave the opening/saving each picture to you, because it looks like PP actually has an extensive built-in library, which is worlds better than GUI scripting. So I’ll tinker with it to see if there’s an option to Auto Straighten that doesn’t really on the GUI.

If you get stuck with how to open and save each file, let us know, and we can help with that too.

-Chris

As a follow up comment to my previous one, here’s a demo macro that works for me. Try it out and let me know if it acomplishes what you need.

Download Macro(s): Open images in Pixelmator Pro and auto straighten them.kmmacros (6.3 KB)

Macro-Image (click to expand/collapse)

Macro-Notes (click to expand/collapse)
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System Information (click to expand/collapse)
  • macOS 13.6
  • Keyboard Maestro v11.0
Full AppleScript (click to expand/collapse)
------------------------------------------------------------
# Author   : Chris Thomerson (@cdthomer)
#
# Version  : 1.0.0 (Initial script)
# History  : 1.0.0 (Initial script)
#
# Created  : Friday, October 27, 2023
# Modified : Friday, October 27, 2023
# macOS    : 13.6 (Ventura)
# Tags     : Pixelmator Pro, Image Editing, Cropping
#
# PURPOSE
# Use the auto-straighten feature
#
# DISCLAIMER
# Permission to use, copy, modify, and/or distribute this
# software for any purpose with or without fee is hereby
# granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
# USE OR PERFORMANCE OF THIS SOFTWARE.
------------------------------------------------------------

# bring PP to the front
tell application "Pixelmator Pro"
	activate
	repeat until frontmost is true
		delay 0.1
	end repeat
end tell

# use the auto-straighten feature
tell application "System Events"
	tell application process "Pixelmator Pro"
		
		# wait for the Crop menu item to appear
		repeat until exists menu item "Crop" of menu 1 of menu bar item "Tools" of menu bar 1
			delay 0.1
		end repeat
		
		# select the Crop menu item
		click menu item "Crop" of menu 1 of menu bar item "Tools" of menu bar 1
		
		# wait for the ML Crop ellipsis to appear
		repeat until exists menu button 1 of scroll area 1 of group 1 of group 2 of window 1
			delay 0.1
		end repeat
		
		# click the ML Crop ellipsis to appear
		click menu button 1 of scroll area 1 of group 1 of group 2 of window 1
		
		# wait for the Auto Straighten menu item to appear
		repeat until exists menu item 1 of menu 1 of menu button 1 of scroll area 1 of group 1 of group 2 of window 1
			delay 0.1
		end repeat
		
		# click the Auto Straighten menu item to appear
		click menu item 1 of menu 1 of menu button 1 of scroll area 1 of group 1 of group 2 of window 1
		
	end tell
end tell

# save and close file
tell application "System Events"
	tell application process "Pixelmator Pro"
		click menu item "Save…" of menu 1 of menu bar item "File" of menu bar 1
		click menu item "Close Window" of menu 1 of menu bar item "File" of menu bar 1
	end tell
end tell

Thanks for your help

Hi
It opens the image in PP and does the straightening, but doesn't click the apply button and the doesnt save and close. would this be added to script all added to macro.
Thanks for your help