AppleScript Automation of Color Adjustment Presets

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2023-03-10 02:02:44

Hi, I am a novice image editor and coder so hopefully this is an easy answer...

I cannot for the life of me to get "apply color adjustment preset" to work... this is the last thing I had (of the multiple attempts). note: I will be replacing the RED preset with the repeat loop item once I get at least one working.

Side note: is there a better way to apply these changes than opening the image with Finder? I had to set all pngs to be opened with Pixelmator due to an error when I tell application "Pixelmator Pro" to open docpath
set color_presets to {"Red - RD3", "Yellow - YW3", "lightBlue - lBL3", "Grey - GY3", "Grey - GY4", "Red - RD2", "Blue - BL3", "Grey - GY1", "Brown - BR5", "Green - GR2", "Brown - BR4", "Green - GR1", "Purple - PL3", "Blue - AQ2", "Yellow - YW2", "PinkRed - PR3", "Blue - BL1", "GreenBlue - GB2", "Grey - GY2", "Orange - OR3", "YellowGreen - YG1", "Purple - PL2"}


repeat with color_preset in color_presets
	
	
end repeat

set docpath to "/Users/timjones/Desktop/TEST/TEST.png"

set dsk to (path to desktop as string)
set docpath to dsk & "iTags:Mood:Angry:Angry.png"
tell application "Finder"
	open docpath
end tell
delay 1

tell application "Pixelmator Pro"
	tell its front document to tell its first layer to apply color adjustments preset {name:"Red - RD3"}
	
end tell

Thanks!