- bases
-- base_1
-- base_2
-- base_3
- flowers
-- flower_1
-- flower_2
-- flower_3
Doing the following gives the an error:tell application "Pixelmator Pro"
set exportLocation to choose folder with prompt "Please choose where you'd like to export the images:"
set totalImages to 8
set counter to 0
tell the front document
repeat totalImages times
set visible of every layer to false
set counter to counter + 1
set visible of (select (layer whose name is equal to "base_" & (random number from 1 to 3))) to true
set visible of (select (layer whose name is equal to "flower_" & (random number from 1 to 3))) to true
export for web to ((exportLocation as text) & "flower_" & counter & ".png") as PNG
end repeat
end tell
end tell
I get the following error: "error "Can’t get layer whose name = \"base_1\"." number -1728"