简体   繁体   English

打开特定文件夹中的文件

[英]Open file in specific folder

I know my filename to open and destination where this file is. 我知道要打开的文件名以及该文件的目标位置。 I can't find function to open specific file as new document in photoshop. 我找不到在Photoshop中将特定文件作为新文档打开的功能。

I have: 我有:

#target photoshop
app.bringToFront();
main();
function main(){

var name; 
var L;

name = app.activeDocument.name;

L = name.length;
L = L - 4;
name = name.substr(0, L);
name = name+"_sufix.png"; 
};

So how can I open file named name? 那么如何打开名为name的文件?

app.activeDocument.name would assume you have already opened the image document app.activeDocument.name会假定您已经打开了图像文档

Try adding this: 尝试添加以下内容:

fileRef = "C:\\directory1\\name.png"

app.open(fileRef) app.open(fileRef)

如果您仍然遇到此问题,请更新您的var名称,例如nameRef,它将正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM