create user interface SELECT FILE AND PAGE
Hi, I need a dialog like this when I open my script.
Field Select file (ai, pdf)
text field page from, page to
these fields must be connected (the data taken), to the following code.
var doc = app.activeDocument;
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var pdfOptions = app.preferences.PDFFileOptions;
var firstPage = <FROM>;
var lastPage = <TO>;
File = <URL OF FILE>
for (i=firstPage; i<lastPage; i++) {
pdfOptions.pageToOpen = i;
var thisPlacedItem = doc.placedItems.add();
thisPlacedItem.file = File;
};

