AppleScript Reorder

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

2022-02-28 15:52:03

Is there a way to flip the order of the layers via AppleScript?

Thank you
User avatar

2022-03-09 15:42:50

Good question! You can try the following script:
tell application "Pixelmator Pro"
	tell the front document
		repeat with a from 1 to number of layers
			move layer (number of layers) to before layer a
		end repeat
	end tell
end tell
One slight issue with AppleScript is that it doesn't really like nested layers, so if there are any groups in your project, you'd have to reorder the layers in them manually.
User avatar

2022-03-09 15:53:18

I ended up solving it another way but thank you.
User avatar

2022-03-10 13:18:31

by dick rick I ended up solving it another way but thank you.
Ah, I see. Perhaps it'll come in handy another time, then. :)
User avatar

2023-11-08 14:41:55

This helped me, thank you!