-
1. Re: Script that resizes canvas. But then won't save
Mattmcquiff May 21, 2013 1:25 AM (in response to Mattmcquiff)Here is a sample of the script and I get the same issue and also the file I am working with
https://dl.dropboxusercontent.com/u/82899493/screenShots/PU005PK_2.psd
tell application "Adobe Photoshop CS6"
activate
set myPNGOptions to {class:PNG save options, interlaced:false}
set aFolder to "StudioA:Users:StudioA:Desktop"
tell current document
tell application "Adobe Photoshop CS6"
set ruler units of settings to pixel units
end tell
(delete layer "Original Image")
delete layer "BACKGROUND" of layer set "Dodge and Burn"
tell current layer to set name to "Main Image"
merge visible layers
trim basing trim on transparent pixels
resize image width 960
resize canvas height 700 anchor position top center
save in (aFolder & name) as PNG with options myPNGOptions without copying
end tell
end tell
-
2. Re: Script that resizes canvas. But then won't save
Muppet Mark May 21, 2013 5:57 AM (in response to Mattmcquiff)Untested but from what I recall…
tell application "Adobe Photoshop CS5"
-- do your app stuff
set ruler units of settings to pixel units
set display dialogs to never
activate
tell current document
-- now do document stuff
(delete layer "Original Image")
delete layer "BACKGROUND" of layer set "Dodge and Burn"
tell current layer to set name to "Main Image"
merge visible layers
trim basing trim on transparent pixels
resize image width 960
resize canvas height 700 anchor position top center
-- use a flexible path to desktop
set aFolder to (path to desktop as text)
set myPNGOptions to {class:PNG save options, interlaced:false}
save in (aFolder & name) as PNG with options myPNGOptions without copying
end tell
-- do your app stuff
set ruler units of settings to mm units
set display dialogs to always
end tell
-
3. Re: Script that resizes canvas. But then won't save
Mattmcquiff May 21, 2013 6:15 AM (in response to Muppet Mark)odd behaviour. How come when the image 'acually gets cropped' it throws up that error?
Surely there must be away to crop without the error message.
Still testing your script above and hopefully its a work around.
-
4. Re: Script that resizes canvas. But then won't save
Muppet Mark May 21, 2013 7:15 AM (in response to Mattmcquiff)It's NOT a workaround but standard scripting procedure… I think everyone starts and ends PS scripts with this… Error dialogs are a different kettle of fish…
-
5. Re: Script that resizes canvas. But then won't save
Mattmcquiff May 21, 2013 7:17 AM (in response to Muppet Mark)No worries, all fully tested and working now!

