Skip to main content
azotez
Known Participant
September 27, 2018
Question

Launch Droplet in Powershell with arguments to be read with a jsx script

  • September 27, 2018
  • 2 replies
  • 1974 views

Hello everyone!

I have a droplet.exe that calls a script.jsx.
I simply want pass an argument from the Windows Powershell to the jsx script.

I tried lots of combinations like the followings but none of them worked.

Example of some Poweshell commands I tried:

C:\users\user\desktop\droplet.exe "M:\images\image1.jpg" --myargument "140cm"
C:\users\user\desktop\droplet.exe "M:\images\image1.jpg" -myargument "140cm"
C:\users\user\desktop\droplet.exe "M:\images\image1.jpg" /myargument "140cm"
C:\users\user\desktop\droplet.exe "M:\images\image1.jpg" \myargument "140cm"

Example of the jsx code I'd like to use:

alert(myargument);

  • Is it something feasible?
  • How should I launch the droplet from the Windows Powershell?
  • How do I read the argument?

Thanks a lot!!

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
September 27, 2018

If you wrote the code for the  droplete.exe its it seeing any arguments.  If its a Photoshop Droplet I do not see anything in the create droplet dialog that would enable you the create a droplet optional option.   The Dialog just looks like Photoshop's Batch Dialog which will play an action on each file in the batch run.  Actions can not use logic so its not possible to pass arguments to actions. Actions can use Plug-in and pass argument to the plug-in ever those argument are hard coder into the action steps that uses plug-ins.  So I would think all a Droplet can do open Photoshop if it is not running once Photoshop is running the droplet will passes a batch job to Photoshop which process the files with the Action used to create the droplet.   If you pass option arguments to a Photoshop droplet what would the droplet do with the option arguments,  There is nothing in the Create Droplet dialog that I see for creating droplet options. The Action use to create the droplet can not process options. If you pass options to a droplet what would a droplet do with them.  Perhaps the droplet would run the batch job and ignore the passed options or take every passed to it to be a file.

The action can use a script that script can be a Plug-in script like Adobe Automate Plug-IN script "Fit Image.jsx"  The action can Pass options to the plug-in however the option are hard coded in the Actions step.  Not rguments  pass to the Action.

You want to pass options to a droplet what woul process the options???

JJMack
azotez
azotezAuthor
Known Participant
September 27, 2018

First of all, thank you!

You want to pass options to a droplet what woul process the options???

The short answer is: the jsx script!
I just need to define a global variable when i call the Photoshop Droplet.

It would be also ok to call the script like a URL with a GET parameter like:

C:\users\user\desktop\droplet.exe "M:\images\image1.jpg?myargument=140cm"

I could parse the "filename" and get the argument I need in my functions, but the above solution does not work.

Is there a way to do it?

Thank you again

JJMack
Community Expert
Community Expert
September 27, 2018

azotez  wrote

First of all, thank you!

You want to pass options to a droplet what woul process the options???

The short answer is: the jsx script!
I just need to define a global variable when i call the Photoshop Droplet.

It would be also ok to call the script like a URL with a GET parameter like:

C:\users\user\desktop\droplet.exe "M:\images\image1.jpg?myargument=140cm"

I could parse the "filename" and get the argument I need in my functions, but the above solution does not work.

Is there a way to do it?

Thank you again

Again the problem is you can not create a Droplet that processes  Options. Also droplet pass a job to Photoshop no to a Photoshop Script.  The job pass plays an action on the file being process. The only way I know how to pass options to a Photoshop script is from an other script or from an action and the script processing the options need to be coded as  a Photoshop plug-in that can process  parameters pass to it.  The plug-in script will bypass displaying it dialog and use the parameters passed.

Photoshop's create Droplet has no options for  creating droplets that can process options you define in the create droplet process.  What you want to do is currently not possible with a Adobe Photoshop droplets..

JJMack
September 27, 2018