Strange Applescript question

What features would you like to see in Pixelmator Pro?
User avatar

2023-10-24 05:38:42

I think I might have uncovered a logical bug somehow. I love that I can draw a selection on my image, which I need for automation of products images, but this (I think) should draw a box 500 px wide and 1000 px tall in my image...but for some reason the right edge is all the way to the right of the image (likely even farther if the image were that size).

The script:

tell application "Pixelmator Pro"
set theDoc to front document
tell theDoc
resize image height 1200 resolution 96 algorithm ml super resolution
set theWidth to width
set theHeight to height
set ourWidth to theWidth / 2
set ourStart to ourWidth - 250
set ourEnd to ourStart + 500
draw selection bounds {ourStart, 100, ourEnd, 1000}
end tell
end tell

The after-running-the-script image:

Image

(You can see that the right edge of the selection is all the way to the right of the image, not 400px to the left of the centerpoint as is my intention.)

One more weird Applescript thing is, when I upscale the image it works well (thanks for adding Applescript support), but I get a weird former image embedded inside the finalized image representing the original size. This is not actually present in the image, just something that the video is displaying, and if I change tools it goes away. Is there an Applescript way to "refresh current window's image" I could be applying?

Image