论坛帮助 |
社区圈子 |
日历事件 |
2020-01-19, 03:50 | #1 | ||
|
|||
见习会员
等级: 小兄弟
|
脚本写好了,可是保存的JPG文件去哪里了?? if (app.documents.length >0 && app.activeDocument.pathItems.length>0) { doc = app.activeDocument; for(var i = 0; i<doc.pathItems.length;i++) { pathRef = doc.pathItems[i]; pathRef.hidden = true; } for(var i = doc.pathItems.length - 1; i>=0;i--) { pathRef = doc.pathItems[i]; pathRef.hidden = false; var exportOptions = new ExportOptionsJPEG(); var type = ExportType.JPEG; var fileSpec = new File( doc.pathItems.length - i); exportOptions.antiAliasing = false; exportOptions.qualitySetting=70; app.activeDocument.exportFile(fileSpec,type,exportOptions); } } if (app.documents.length >0 && app.activeDocument.pathItems.length>0) { doc = app.activeDocument; for(var i = 0; i<doc.pathItems.length;i++) { pathRef = doc.pathItems[i]; pathRef.hidden = true; } for(var i = doc.pathItems.length - 1; i>=0;i--) { pathRef = doc.pathItems[i]; pathRef.hidden = false; var exportOptions = new ExportOptionsJPEG(); var type = ExportType.JPEG; var AAA = doc.pathItems.length - i; if(AAA<10) { AAA ="00"+AAA; } else if(AAA<100) { AAA ="0"+AAA; } var fileSpec = new File(doc.path +"/"+AAA+doc.name); exportOptions.antiAliasing = false; exportOptions.qualitySetting=70; app.activeDocument.exportFile(fileSpec,type,exportOptions); } } 现在是 默认路径+序列号+文件名+扩展名。很想知道怎么单独获取“文件名”,而不是“文件名.扩展名” 此帖于 2020-01-19 15:42 被 A-J 编辑. |
||