• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to open indd or indt files from UXP script (injs) ?

Participant ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

I want to open the INDT template file from a IDJS (UXP) script to make changes and save INDD with the new name. Previously this was done using the File class:

 

var f = new File('path');
app.open(f);

 

How can I do this within UXP Fs?

 

TOPICS
How to , UXP Scripting

Views

421

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 09, 2023 Sep 09, 2023

Use getEntryWithUrl to convert a path string to an Entry and open it.

const { localFileSystem } = require('uxp').storage ;
const { app } = require('indesign') ;

const entry = await localFileSystem.getEntryWithUrl('/Users/username/Desktop/template.indd') ;
app.open(entry) ;

Votes

Translate

Translate
Community Expert ,
Sep 09, 2023 Sep 09, 2023

Copy link to clipboard

Copied

LATEST

Use getEntryWithUrl to convert a path string to an Entry and open it.

const { localFileSystem } = require('uxp').storage ;
const { app } = require('indesign') ;

const entry = await localFileSystem.getEntryWithUrl('/Users/username/Desktop/template.indd') ;
app.open(entry) ;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines