Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

How to call droplet programmatically

Community Beginner ,
Dec 09, 2019 Dec 09, 2019

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?

TOPICS
Edit and convert PDFs , How to
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Beginner ,
Dec 09, 2019 Dec 09, 2019
LATEST

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 09, 2019 Dec 09, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 09, 2019 Dec 09, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines