Copy link to clipboard
Copied
I often build up a document by adding pages from various sources in chronological order, with the most recent first, so I insert pages with the settings Before First a lot. I have to set them every time I've opened Acrobat, though. (I'm using Acrobat 8 Standard, Acrobat 9 Pro, Acrobat DC, & other versions on other machines.) I only takes a couple of keystrokes or key combinations, but I do it so much that I'd love to avoid even that & just have the default set to insert before the first page. Is there any way to do so?
Hello Tim,
The below code creates a custom menu item using javascript, it inserts pages "Before First" from a selected pdf file.
//Save this in the ....\Acrobat\Javascripts\ program or user directory
// as a .js file to load as Add-In
app.addSubMenu({ cName: "Custom Tools", cParent: "Edit", nPos: 0 });
app.addMenuItem({ cName: "Insert pages before first", cParent: "Custom Tools", cExec: "insertPagesBefore()"});
insertPagesBefore = app.trustedFunction(function (){
app.beginPriv();
va
...
Copy link to clipboard
Copied
Hi Timothy,
It's been my experience that this setting is "sticky." That is if you set it to Before First one time, the next time you use it it will be set to the same thing.
Is this not happening?
Copy link to clipboard
Copied
Gary, thanks for replying. The setting is sticky as long as I keep Acrobat open, but if I close it and reopen it, the defaults of Insert After and the current page are in place again. I'm looking for a way to change the defaults themselves, so that when I open Acrobat, the settings are Insert Before and first page without my having to change them the first time I insert a page.
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
That's what I was afraid of. Bernd, you say it quite absolutely. Is that based on a documented limitation or just practical experience wherein you've also not found a way to do it? Thanks.
Copy link to clipboard
Copied
There is no setting for this.
Copy link to clipboard
Copied
Hello Tim,
The below code creates a custom menu item using javascript, it inserts pages "Before First" from a selected pdf file.
//Save this in the ....\Acrobat\Javascripts\ program or user directory
// as a .js file to load as Add-In
app.addSubMenu({ cName: "Custom Tools", cParent: "Edit", nPos: 0 });
app.addMenuItem({ cName: "Insert pages before first", cParent: "Custom Tools", cExec: "insertPagesBefore()"});
insertPagesBefore = app.trustedFunction(function (){
app.beginPriv();
var userPickedDoc = app.browseForDoc();
var sourceDoc = userPickedDoc.cPath;
this.insertPages({nPage:-1, cPath: sourceDoc});
app.endPriv();
app.alert("Done inserting pages before first!");
})
Regards,
Mike
Copy link to clipboard
Copied
Mike,
That worked brilliantly. I made a couple minor changes to facilitate quick keyboard access and removed the post-insertion alert (which was a good touch for debugging, but not necesssary for operational use). I appreciate your taking the time to provide such a helpful response!
For reference, here's what I hacked your code into:
app.addSubMenu({ cName: "&Custom Tools", cParent: "Edit", nPos: 0 });
app.addMenuItem({ cName: "Insert &Before", cParent: "&Custom Tools", cExec: "insertPagesBefore()"});
insertPagesBefore = app.trustedFunction(function (){
app.beginPriv();
var userPickedDoc = app.browseForDoc();
var sourceDoc = userPickedDoc.cPath;
this.insertPages({nPage:-1, cPath: sourceDoc});
app.endPriv();
})
Warm & grateful regards,
Timothy