Applescript multiple strokes

Discuss and share Pixelmator Pro resources such as templates, mockups, and tutorials.
User avatar

2022-11-18 22:13:56

I would like to write appleScript that can apply two strokes to a shape layer, but not having any luck. I've put some code below that gives the idea, but this isn't working for me.
tell style 1 of Shape
   set its stroke width to 50
   set its stroke color to color1
end tell
tell style 2 of Shape
   set its stroke width to 100
   set its stroke color to color2
end tell
Any idea if this is possible, and how to do it?
User avatar

2023-01-13 21:19:37

chatGPT suggested a couple of methods, but all generated an error. Here's the latest of what I've gotten - and don't know how to fix it.:

tell application "Pixelmator Pro"
activate
set theLayer to selected layer of front document
set theShape to first item of vector shapes of theLayer
set properties of theShape to {stroke color:{255, 0, 0}, stroke width:10}
set properties of theShape to {stroke color:{0, 255, 0}, stroke width:5}
end tell

I'm curious too.

the error on this code was

'Syntax Error
Expected end of line, etc. but found
class name.'

and hilites the word 'layer'