How do I open file explorer and get selected file path with JS editor?
I've been trying to create a script to select a pdf containing the front sides of pages and another pdf containing the backside of pages, then combine them with the proper order.
This is what I have so far:
var myDoc = app.newDoc();
var frontSidePg = "<Path to front side pages pdf>";
var backSidePg = "<Path to back side pages pdf>";
// Only here for getting page count
var fDoc = app.openDoc({
cPath: frontSidePg
});
// Insert front and back pages in correct order
for (var i=0; i<fDoc.numPages; i++) {
// Front Pages
myDoc.insertPages({
nPage : myDoc.numPages-1,
cPath : frontSidePg,
nStart: i
});
// Back Pages
myDoc.insertPages({
nPage : myDoc.numPages-1,
cPath : backSidePg,
nStart: fDoc.numPages-i-1
});
}
myDoc.deletePages({nStart:0}); // Delete blank initial pageI have other co-workers who will likely be using this script so I can't expect them to manually change the file paths each time.
I've tried things like:
app.execMenuItem("Open");
var frontSidePg = String(this.path);But it breaks when I try to get the second document needed.
I can't seem to find anything else in the API documentation to help me here.
