taiyodayo
taiyodayo

Reputation: 377

InDesign jsx opening files with specific options

I am trying to batch process .indd files created many years ago on old versions of InDesign.

I have 2 goals:

  1. Open .indd files without having to manually click on the dialogs:- "Update linked images? (select 'update')", "font errors (select 'Skip')"
  2. Save files to .indd, current versions native format, attaching _cc2020 to their original filename.

Here's how I am doing so far:

// 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'));

I could not find ways to suppress (or provide preset default value to) the two dialogs. Could someone please enlighten me how I can achieve this?

ps. I found providing false as second argument will suppress font dialogs, but "update images" dialogs still persists.

// open file(s)
fileObj = app.open(list_of_files, false);

resource I've been referring to https://wwwimages2.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/scripting/InDesign_ScriptingGuide_JS.pdf

Upvotes: 0

Views: 567

Answers (1)

user1754036
user1754036

Reputation: 544

Suppress dialogues with

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

Upvotes: 1

Related Questions