Skip to main content
vnh68
Inspiring
September 9, 2023
Answered

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

  • September 9, 2023
  • 1 reply
  • 652 views

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?

 

This topic has been closed for replies.
Correct answer sttk3

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

1 reply

sttk3Correct answer
Legend
September 9, 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) ;