Copy link to clipboard
Copied
Greetings,
I've recently created a script that takes a PDF and splits it up into many pieces, saving the pieces in whatever folder the PDF resides in. I'm searching for the simplest way to have my users use this script. So far my current method is copy - pasting it into the console, highlighting all the text (Ctrl + a), and then hitting Ctrl + enter.
After searching around, I found that Acrobat has a Javascripts folder in C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts. I placed my script (saved as .js) in the folder, and enabled the debugger in settings. I now see my script loaded in the debugger, but I cant seem to run it. I assume the green button at the top would execute it, but no luck. I've attached a screenshot, my script is the "page1splitter.js"
Am I missing something? Thanks in advanced!
Copy link to clipboard
Copied
If they use Acrobat Pro you should place your script in an Action, it's more user-friendly (double-clic to install).
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
If the script is located in a function you can call that function from the Console.
If it's not in a function then you can't call it, as it executes when the application opens.
Copy link to clipboard
Copied
Hey try67,
Thanks for providing me with some insight here. The function idea is good, it defeintly would be simpler than my current process. But I'd like to get it even simpler if possible.
I was hoping to load the script into the Javasccripts folder, then have a user click on a button of some sort that does the same as highlighting and Ctrl+enter on the text. Do you know if thats possible?
Copy link to clipboard
Copied
Of course. You would still need to place the code in a function, but then you could call that function via a button, using the addToolButton method of the app object.
Copy link to clipboard
Copied
If they use Acrobat Pro you should place your script in an Action, it's more user-friendly (double-clic to install).
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
Or a Custom Command. Acrobat provides easy methods for exporting and importing both Actions and Custom Commands.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thank you both! I ended up putting my script in an action (New Action > More Tools > Execute Javascript). Going to play around with the exporting now, but this works for me either way. Cheers!

