Copy link to clipboard
Copied
I'm using Photoshop's Droplet feature to prepare images for OCR as well as crop and center the original images. It's one part of a larger script which automatically takes some .jpgs and the end result is the script uploads them (cropped) to a database along with data gathered from the OCR output. It's pretty much set it and forget it, except Photoshop gets opened and doesn't close when the macro/script/program finishes running. I could add code to kill Photoshop when everything's finished, but I'd really like to be not even have Photoshop load the GUI in the first place. Is it at all possible to just run Photoshop in the command line with no GUI ever getting loaded? It takes a few seconds to load Photoshop every time the script is run, and it interupts anything else I'm doing at the time. Having Photoshop already loaded and minimized when the script is run does not prevent PS from stealing focus.
I don't think this is possible - I didn't find any solutions while searching Google (besides using ImageMagick instead of PS, which I may look into as I'm not doing anything particularly advanced in Photoshop - mostly levels manipulation and desaturation to produce black on white text) and I've never heard anything to suggest this is possible. Still I'm by no means an expert in Photoshop, so who knows.;)
Is it at all possible to just run Photoshop in the command line with no GUI ever getting loaded?
No. The best you can do is run it with all of the panels hidden and then use the OS to 'hide' the application. This works out pretty well on the Mac, not quite so good on Win.
Also, a one line script can be used to shutdown PS.
executeAction(charIDToTypeID('quit'), new ActionDescriptor(), DialogModes.NO);
Copy link to clipboard
Copied
Is it at all possible to just run Photoshop in the command line with no GUI ever getting loaded?
No. The best you can do is run it with all of the panels hidden and then use the OS to 'hide' the application. This works out pretty well on the Mac, not quite so good on Win.
Also, a one line script can be used to shutdown PS.
executeAction(charIDToTypeID('quit'), new ActionDescriptor(), DialogModes.NO);
Copy link to clipboard
Copied
Thanks. I'm on Windows, but I'll try that out anyway.
The code won't work since I'm not actually using Photoshop's scripting - I am using Java. I don't think PS scripting would allow 90% of what my script/program does. Thanks anyway.
Copy link to clipboard
Copied
The code won't work since I'm not actually using Photoshop's scripting - I am using Java
If you want the droplet to shutdown PS before it's done, do an 'Insert Menu Item' and add 'File > Exit' as the last step in the action and resave the droplet. No need for JS.
Copy link to clipboard
Copied
I don't know Java but if adding an exit step to your action isn't something you want to do I would think that you could still run the quit code at any point you like. You would have to convert what Xbytor posted from javascript to java but executeAction and charIDToTypeID are methods of the Photoshop application object. Unless you are not using the COM to drive Photoshop from java.
Copy link to clipboard
Copied
On windows I would control Photoshop via VBScript or any OLE Automation supported language and set the visible property
to false.
app.visible = true