InDesign jsx 打开具有特定选项的文件
InDesign jsx opening files with specific options
我正在尝试批处理 .indd
多年前在旧版 InDesign 上创建的文件。
我有两个目标:
- 打开
.indd
个文件而无需手动单击
对话框:- “更新链接图像?(select 'update')”、“字体错误
(select 'Skip')"
- 将文件保存为
.indd
,当前版本的原始格式,将 _cc2020
附加到其原始文件名。
这是我目前的表现:
// Opening files
// specify source folder
path = '~/Desktop/source_dir';
// list files in the folder
var my_folder = new Folder(path);
list_of_files = my_folder.getFiles();
// open file(s)
fileObj = app.open(list_of_files);
// saving files
// get current documents
myDoc = app.activeDocument;
// save current document with specific name
myDoc.save(File('~/Desktop/test01.indd'));
我找不到抑制(或提供预设默认值)这两个对话框的方法。
有人可以告诉我如何实现吗?
ps。我发现提供 false
作为第二个参数会抑制字体对话框,但 "更新图像" 对话框仍然存在。
// open file(s)
fileObj = app.open(list_of_files, false);
禁止与
对话
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
我正在尝试批处理 .indd
多年前在旧版 InDesign 上创建的文件。
我有两个目标:
- 打开
.indd
个文件而无需手动单击 对话框:- “更新链接图像?(select 'update')”、“字体错误 (select 'Skip')" - 将文件保存为
.indd
,当前版本的原始格式,将_cc2020
附加到其原始文件名。
这是我目前的表现:
// Opening files
// specify source folder
path = '~/Desktop/source_dir';
// list files in the folder
var my_folder = new Folder(path);
list_of_files = my_folder.getFiles();
// open file(s)
fileObj = app.open(list_of_files);
// saving files
// get current documents
myDoc = app.activeDocument;
// save current document with specific name
myDoc.save(File('~/Desktop/test01.indd'));
我找不到抑制(或提供预设默认值)这两个对话框的方法。 有人可以告诉我如何实现吗?
ps。我发现提供 false
作为第二个参数会抑制字体对话框,但 "更新图像" 对话框仍然存在。
// open file(s)
fileObj = app.open(list_of_files, false);
禁止与
对话app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;