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

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

Participant ,
Sep 08, 2023 Sep 08, 2023

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
640
Translate
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

Enthusiast , 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) ;
Translate
Enthusiast ,
Sep 09, 2023 Sep 09, 2023
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) ;
Translate
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