Copy link to clipboard
Copied
Hi, everyone
I want open a folder on desktop after gen PDF but error, can someone help me to fix it?
var f = new Folder(“~/Desktop/Revised_PDF put in here/”);
f.create();
var doc = app.documents;
app.findTextPreferences = null;
app.findTextPreferences.underline = true;
for(var i=0;i<doc.length;i++)
{
var found = doc.findText();
var _pages = [];
for(var j=0;j<found.length;j++)
{
var txfms = found
for(var k=0;k<txfms.length;k++)
{
_pages.push(txfms
}
}
for(var j=0;j<_pages.length;j++)
{
if(_pages
{
_pages.splice(j,1);
}
}
if(_pages.length != 0)
{
app.pdfExportPreferences.pageRange = _pages.toString();
doc.exportFile(ExportFormat.PDF_TYPE, new File(“~/Desktop/Revised_PDF put in here/” + doc.name.replace(/\.indd$/i,”.pdf”)), false);
}
_pages = [];
}
app.findTextPreferences = null;
folder.open(“~/Desktop/Revised_PDF put in here/”) // <-----------this line error
John
#target indesign
var f = Folder( Folder.desktop + '/Testing' );
if ( ! f.exists ) { f.create(); };
f.execute();
Wow this thing for pasting syntax is now SHITE… CAN'T see it have to load the go back and edit C&P only works half the time…
Copy link to clipboard
Copied
The method to open a Folder Object as if clicked in the UI is Folder.execute();
Copy link to clipboard
Copied
Hi,
I have tried, but not work
what is the syntax? John
Copy link to clipboard
Copied
#target indesign
var f = Folder( Folder.desktop + '/Testing' );
if ( ! f.exists ) { f.create(); };
f.execute();
Wow this thing for pasting syntax is now SHITE… CAN'T see it have to load the go back and edit C&P only works half the time…
Copy link to clipboard
Copied
Hi, Mark
thanks
John