[Help] Writing a Pixelmator Pro Script (Stroke color codes???)

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

2023-01-29 03:42:30

Hello, fellow Pixelmator Pro users and developers:

I run an Etsy shop that's focused around selling stickers, and I create my thumbnails with Pixelmator. I have SVG art that I create, and I convert the layer to pixels and then add a white stroke to it.

I looked through the script dictionary and noticed that the color decimal numbers go up to 65535. When looking up the value I need for white, what I got exceeds that limit. Is there any work around or value you know of that would get me the color I need? Here's the code so far:
tell application "Pixelmator Pro"
	tell its front document
		tell its first group layer
			convert into pixels
		end tell
		tell its first layer
			tell its styles
				set its stroke width to 40
				set its stroke position to outside
				set its stroke color to {167772, 167772, 167772}
			end tell
		end tell
	end tell
end tell
User avatar

2023-01-30 17:58:04

HHHmmmm. This works for me. But as I go back to PixPro, undo everything - one at a time - ⌘z first the white goes away leaving a black stroke underneath it, ⌘z the black layer goes from outside to inside, ⌘z finally the black goes away, ⌘z return to a shape. A sequence I find odd.
Image