admin 管理员组文章数量: 1086019
I'm having trouble saving for some reason; I'm using Photoshop CS5.1 (if that really is the cause of the issue)
error 8800: General Photoshop error occurred.
This functionality may not be available in this version of Photoshop.
Could not save a copy as C:\...\Temp001.jpeg0011338281522"
because the file could not be found
var thistimestamp = Math.round(new Date().getTime() / 1000);
saveFile = new File( "/Users/Barny/My Pictures/Temp001" +thistimestamp+ ".jpeg" )
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 9;
app.activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
I'd like the script to save and close, but I keep getting this error. I'm using Photoshop CS5.1 (if that really is the cause of the issue)
I'm having trouble saving for some reason; I'm using Photoshop CS5.1 (if that really is the cause of the issue)
error 8800: General Photoshop error occurred.
This functionality may not be available in this version of Photoshop.
Could not save a copy as C:\...\Temp001.jpeg0011338281522"
because the file could not be found
var thistimestamp = Math.round(new Date().getTime() / 1000);
saveFile = new File( "/Users/Barny/My Pictures/Temp001" +thistimestamp+ ".jpeg" )
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 9;
app.activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
I'd like the script to save and close, but I keep getting this error. I'm using Photoshop CS5.1 (if that really is the cause of the issue)
Share Improve this question edited May 29, 2012 at 9:02 Barney asked May 29, 2012 at 8:56 BarneyBarney 1,8485 gold badges31 silver badges51 bronze badges 1- 1 In what context is your JS running? – Jon Cram Commented May 29, 2012 at 9:31
1 Answer
Reset to default 6When you get the error General Photoshop error
while saving it usually means a problem with the save path. Photoshop is trying to save to a location that doesn't exist. This works assuming the folder C:/Users/Barney/Pictures/Temp001
exists:
var thistimestamp = Math.round(new Date().getTime() / 1000);
saveFile = new File( "c:/Users/Barney/Pictures/Temp001/" +thistimestamp)
saveOptions = new JPEGSaveOptions();
saveOptions.embedColorProfile = true;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
saveOptions.quality = 9;
app.activeDocument.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);
The only changes I made were to to the path string saveFile = new File("C:/Users/Barney/Pictures/Temp001/" + thistimestamp)
Notice I added the C:
to make it an absolute path and added a /
after Temp001 to specify this is a folder and not part of the final file name. My Pictures
should actually be Pictures
(my pictures is just an alias), which is what you get if you copy the address from the address bar. Also I removed the + ".jpeg"
because photoshop takes care of the file extension for you.
If you're trying to create a new folder you have to use the Folder
object:
var myfolder = new Folder("c:/Users/Barney/Pictures/Temp001/");
myfolder.create();
本文标签: Photoshop Javascript scripting saving and closing documentStack Overflow
版权声明:本文标题:Photoshop Javascript scripting saving and closing document - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1743988905a2514359.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论