Copy link to clipboard
Copied
I've created a simple optimization preflight and made a droplet for it.
When I drop a file on the droplet, it does what I expect. (Optimize then save the file)
I'd like to be able to call this droplet programmatically from a PowerShell or other script.
I've tried the obvious:
D:\Testing\SimpleOptimize.exe optimizeme.pdf
This appears to run the preflight operation (I can see the preflight window pop up and it appears to process the file) but it does not save the file. The original file remains untouched.
Is there a way to call the droplet programmatically? What are the command line switches?
Copy link to clipboard
Copied
I can't speak for OSX apps, but in Windows, dropping a file on an executable is the equivalent of launching the executable with the path to the dropped file as the first argument in the argument list. (Or a list of files in an array if multiple are dropped)
It turns out this actually works fine; my issue was in my script. I wasn't providing an absolute path so the PDF didn't exist in the location where it was expected.
To summarize, in PowerShell if you execute the following, a droplet can be automated:
Start-Process C:\Path\To\Droplet\dropletname.exe -ArgumentList "C:\Path\To\PDF\optimizeme.pdf" -Wait -NoNewWindow -PassThru
This works. I just processed 122 files using this method.
Copy link to clipboard
Copied
Droplets aren't designed for using programmatically. They might work, but you can't assume the command line is as you say. There is no documentation whatever. This is deliberate, so you don't try to use Acrobat for heavy duty automation.
Copy link to clipboard
Copied
I can't speak for OSX apps, but in Windows, dropping a file on an executable is the equivalent of launching the executable with the path to the dropped file as the first argument in the argument list. (Or a list of files in an array if multiple are dropped)
It turns out this actually works fine; my issue was in my script. I wasn't providing an absolute path so the PDF didn't exist in the location where it was expected.
To summarize, in PowerShell if you execute the following, a droplet can be automated:
Start-Process C:\Path\To\Droplet\dropletname.exe -ArgumentList "C:\Path\To\PDF\optimizeme.pdf" -Wait -NoNewWindow -PassThru
This works. I just processed 122 files using this method.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now