javascript - 在 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 );
我已经尝试过我在网上阅读过的各种东西,但是对于这些东西是新手,要么它们不适用,要么我可能错误地使用它们。
提前致谢。
解决方案
您需要将子文件夹名称添加到putPath
:
desc217.putPath( idnull, new File (workingPath + "/subfolder/Texture_FOP.tif" ) );
推荐阅读
- java - 在创建 Magnolia CMS 时访问当前表单
- c# - 在 WPF 安装项目的先决条件中添加第三方 SDK
- aem - 如何从 aem dam 读取 excel 并使其可供用户下载
- sql - Postgres 9.6 上的 plv8:以前的 INSERT 结果以后不可用
- angular - 如何将我的搜索过滤器与我的列表组件以角度链接?
- php - PHP如何读取不属于www-data的文件
- python - 从 Python 中的另一个类访问变量
- xcode - xcode 项目在没有 .xcodeproj 文件的情况下打开
- google-apps-script - 由于不同的 eventId 格式,无法为在 iOS 上创建的事件加载带有 getEventByID 的日历事件
- wso2 - 如何在 wso2 API 管理器中增加输入有效负载大小