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?
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) ;
Copy link to clipboard
Copied
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) ;