2 Questions

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

2020-11-28 12:02:07

1) I am looking for the flatten command, which will flatten the image down to 1 layer, for when ready to export.

2) I can't seem to find the colour panel, which shows what the currently selected foreground and background colours are?

Any help would be appreciated.

Thank you.
User avatar

2020-12-01 14:51:14

Flatten is usually called Merge in Pixelmator Pro, and you can find the Merge All command in the Arrange menu – its keyboard shortcut is Option-Shift-Command-E.

There isn't a place to see the foreground and background colors – the background color is really more of a hidden feature. It exists, but it's reachable by keyboard shortcuts only – the X key. But if you press the I key to switch the Color Picker tool, you'll see what the currently selected color is in the color well. Then, pressing the X key will show you the other color (foreground or background, depending on which one was selected previously).
User avatar

2020-12-01 14:59:24

Thank you very much - I will take a look.
User avatar

2020-12-01 15:20:41

Good luck!

P.S. I totally butchered the keyboard shortcut. I fixed it in my original reply, but just to reiterate here, the shortcut is: Option-Shift-Command-E
User avatar

2020-12-02 09:50:29

Thanks Andrius.
Is there by chance an AppleScript example, which will merge all selected layers?

I am trying to create scripts which will allow me easier access to certain functions.

Any help would be greatly appreciated.

Thank you.
User avatar

2020-12-02 12:32:29

There isn't an example available, but I'll gladly put one together for you:
tell application "Pixelmator Pro"
	tell the front document
		merge layers {layer 1, layer 3, layer 5}
	end tell
end tell
I usually put the application tell in these scripts, but the relevant part is really just lines 2-4. The main points being:

1) This is a command executed on the document rather than a layer or the app, so if you're in a layer tell (or deeper), you'll need to make sure you get back to the document level.
2) You need to pass a list of layers to be merged. If there is a number of layers that are already selected in your image, then you could use something like this:
tell application "Pixelmator Pro"
	tell the front document
		merge layers (every layer whose selected is true)
	end tell
end tell
But this function (merging selected layers) is already available in the Arrange menu and has the Option-Command-E keyboard shortcut. Or is that not sufficient for your needs?
User avatar

2020-12-02 14:08:37

Thank you so much Andrius!
Besides being a designer, I’m also a software developer, and have created my own app which acts as a kind of extended UI - whereby I have one-click access to numerous Applescripts.

Much appreciated!