Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/412.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
保存目标文件夹Photoshop Javascript_Javascript_Photoshop_Photoshop Script - Fatal编程技术网

保存目标文件夹Photoshop Javascript

保存目标文件夹Photoshop Javascript,javascript,photoshop,photoshop-script,Javascript,Photoshop,Photoshop Script,我目前正在尝试添加此Photoshop脚本,该脚本当前从文件夹中获取大量图像文件,并替换智能对象的内容,并保存单个JPG: 目标photoshop 如果app.documents.length>0{ var myDocument=app.activeDocument; var theName=myDocument.name.match/*\.[^\.]+$/[1]; var thePath=myDocument.path; var theLayer=myDocument.activeLayer

我目前正在尝试添加此Photoshop脚本,该脚本当前从文件夹中获取大量图像文件,并替换智能对象的内容,并保存单个JPG:

目标photoshop 如果app.documents.length>0{ var myDocument=app.activeDocument; var theName=myDocument.name.match/*\.[^\.]+$/[1]; var thePath=myDocument.path; var theLayer=myDocument.activeLayer; //jpg期权; var jpgopts=新的JPEGSaveOptions; jpgopts.embedProfile=true; jpgopts.formatOptions=formatOptions.STANDARDBASELINE; jpgopts.matte=MatteType.NONE; jpgopts.quality=8; //检查图层是否为智能对象; 如果layer.kind!=LayerKind.SMARTOBJECT{警告所选层不是智能对象} 否则{ //选择文件; 如果$.os.search/windows/i!=-1{var theFiles=File.openDialog请选择文件,*.psd;*.tif;*.jpg,true} 否则{ //var theFiles=File.openDialog请选择文件,getFiles,true}; var theFolder=Folder.selectDialog选择文件夹; 如果你离开了{ var theFiles=theFolder.getFiles/\.jpg | tif | eps | psd | png$/i }否则{ var theFiles=File.openDialog请选择文件,getFiles,true}; }; 如果文件{ //通过阵列工作; 对于var m=0;m
var thePath = myDocument.path;
// manually save det destination folder
var outputFolder = Folder.selectDialog("Choose folder to save files to");
然后在保存文件时设置此选项

// myDocument.saveAs((new File(thePath+"/"+theName+"_"+theNewName+".jpg")),jpgopts,true);
myDocument.saveAs((new File(outputFolder+"/"+theName+"_"+theNewName+".jpg")),jpgopts,true);

好吧,你哪里有麻烦?嗨,艾米!非常感谢你的回复。我的问题实际上是我缺乏JavaScript素养:S。我不确定在这段代码中插入正确的代码行以打开一个对话框,该对话框允许我为保存的文件设置目标文件夹。