photoshop scripting problem - seemingly simple

I’m attempting to make a script where i have a simple 500 by 500 document filled with noise and i want to extend the area above the noise by 100 pixels (resize canvas) and then select that white area. It seems simple but can anyone tell me why this doesn’t work?


tell application "Adobe Photoshop CS"
activate
set w to width of current document
set h to height of current document
set e to (h * 0.2)
resize canvas current document height (h + e) anchor position bottom center
select current document region {{0,0},{w,0},{w,e},{0,e}}
end tell

When I run the script noting happens not even an error. Any advice would be much appreciated. Thanks.

Filo,

Your script works fine on my end. Although its fine in this script, you might want to specify your measurement units to prevent issues in the future (“set w to width of current document as pixels”).

As far as “nothing happening”, does PS CS need the scripting plug-in ? I know earlier versions did…

-N

Thanks for testing it ive got it working now im not entirely sure what the problem was i just fiddled around and eventually it worked. Anyway cheers for the help.