首页 > 解决方案 > 在 Photoshop 中访问活动文档路径的子文件夹

问题描述

请帮忙,这让我发疯。

我脚本的这一部分替换了智能对象的内容。它成功地在 activeDocument.path 中找到要用于替换的文件,但我终生无法访问我希望存储所有图像的子文件夹。避免在与 PSD 相同的文件夹中有大量文件。

var idplacedLayerReplaceContents = stringIDToTypeID( "placedLayerReplaceContents" );
    var desc217 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    var workingPath  = app.activeDocument.path;
    desc217.putPath( idnull, new File ("Texture_FOP.tif" ) );
executeAction( idplacedLayerReplaceContents, desc217, DialogModes.NO );

我已经尝试过我在网上阅读过的各种东西,但是对于这些东西是新手,要么它们不适用,要么我可能错误地使用它们。

提前致谢。

标签: javascriptphotoshopsubdirectory

解决方案


您需要将子文件夹名称添加到putPath

desc217.putPath( idnull, new File (workingPath + "/subfolder/Texture_FOP.tif" ) );


推荐阅读