Skip navigation
This discussion is archived
John Hawkinson 5,572 posts
Jun 25, 2009
Currently Being Moderated

Re: Very basic script needed to do 4 things

Jun 1, 2011 1:28 AM

Have you read the scripting guide or do you have any familiarty with Javascript?


I don't think the scripting DOM lets you access what is in the operating system cut buffer easily.

I guess on a Mac you can use AppleScript:

 

var filename = app.doScript("the clipboard",
    ScriptLanguage.APPLESCRIPT_LANGUAGE);

 

I would think you would be better off naming your ref# textframe in the Layers panel and then using

 

var filename = app.activeDocument.textFrames.
    item("referencenumber").contents;

 

Then for the rest:

 

//print the document
app.activeDocument.print(false, "presetName");
// save it
app.activeDocument.save(new
    File("/path/to/my/file/"+filename+".indd"));
// export eps
app.activeDocument.exportFile(ExportFormat.EPS_TYPE,
    new File("/path/to/othername.eps"));
// export PDF
app.activeDocument.exportFIle(ExportFormat.PDF_TYPE,
    new File("/pat/to/othername.pdf"));

 

though you probably want to specify some pdf export options...

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)