Run, save, close: is it possible?

Moderator: jsachs

elbitjusticiero
Posts: 9
Joined: October 17th, 2023, 9:22 am

Run, save, close: is it possible?

Post by elbitjusticiero »

Hi everyone! I am stuck in a situation where I don't know how to get a script to automatically save my image. What I want to do should be possible, I think -- but I can't find the way to do it in the documentation. Maybe I'm not understanding very well.

I have a script I use to resize an image and superimpose it into a blurred background of itself. The script gets the image from the clipboard, and at the end there is a transformation to save the picture to a file. My idea is to run this script and have PWP automatically save the file and exit.

The first problem is that the file is not actually saved until I click on the "Write File" button in the transformation. This being a script, I thought it would happen automatically.

The second problem is I don't know how to tell PWP it should auto-close after the script is finished. Is this possible?

Thanks for any pointers you can give me! Have a nice day everyone.
pierrelabreche
Posts: 420
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Run, save, close: is it possible?

Post by pierrelabreche »

Use transformation file ...
You can actually process a batch of files using batch processing in the input part of the script, the very first top element in the series of transformations.
elbitjusticiero
Posts: 9
Joined: October 17th, 2023, 9:22 am

Re: Run, save, close: is it possible?

Post by elbitjusticiero »

I'm not sure I understand. I'm getting the image from the clipboard.

There are three File transformations: Export, Print, and Slide Show. I'm using the Export transformation at the end of my workflow.

How would I add this batch option at the beginning? What do I need to do?
jsachs
Posts: 4218
Joined: January 22nd, 2009, 11:03 pm

Re: Run, save, close: is it possible?

Post by jsachs »

For details on batch operations, download the document Batch Processing.pdf. Basically, you need to use the File Open transformation to initiate the batch process.

There is no way to get PWP to batch process from the clipboard or to exit automatically when done so it does not sound like it will do what you want. It is really designed to automate applying a series of transformations to a list of image files.
Jonathan Sachs
Digital Light & Color
elbitjusticiero
Posts: 9
Joined: October 17th, 2023, 9:22 am

Re: Run, save, close: is it possible?

Post by elbitjusticiero »

But the Export transformation should work, right?

When I execute the script, every transformation is executed in order, EXCEPT the final Export. I need to manually click on the "Write File" button for it to actually save the image.

I can share my script if it would be useful.
pierrelabreche
Posts: 420
Joined: January 29th, 2019, 11:47 pm
What is the make/model of your primary camera?: Nikon Z8

Re: Run, save, close: is it possible?

Post by pierrelabreche »

When you execute PWP in batch processing, you do not need to click on the button "write file" for the file export transformation.
The batch processor writes the file to be exported without user interaction.
elbitjusticiero
Posts: 9
Joined: October 17th, 2023, 9:22 am

Re: Run, save, close: is it possible?

Post by elbitjusticiero »

I've read the Batch Processing doc and I'm just as confused as before.

It looks like this batch mode is actually not an unattended process, but you need to manually open the files to be processed? I don't need a batch process in the sense that I want to process several files at once; what I want is to process a single image, but in an unattended mode, through a script. (The doc also seems to imply that this process cannot come from the clipboard, but only from a list of files.)

What I have now is a script that I can invoke through the command line, that runs PWP, pastes the clipboard, applies some transformations to it, and includes an Export transformation. But the Export transformation doesn't fire up on its own like the others.

I'm attaching the script so that you can review it.

(EDIT: I'm fine with PWP staying open after saving the file; I can close the program manually, or just leave it open. What I want to avoid is the hassle of going to its window to apply the transformation myself.)
Attachments
verticaltohorizontal.script
(3.71 KiB) Downloaded 37 times
jsachs
Posts: 4218
Joined: January 22nd, 2009, 11:03 pm

Re: Run, save, close: is it possible?

Post by jsachs »

As I said before, batch only works from File Open, not from Paste. You initiate batch operations from the File Open transformation, and it runs a series of image files through the same script. When running a batch process, Export saves a new file for every image file you start with. I understand what you are trying to do but you cannot do it with Picture Window.

Opening a script file is not the same as running a batch process and it will not export unless you press the button -- otherwise every time you recalculated the file you wanted to export, it would create another copy.
Jonathan Sachs
Digital Light & Color
elbitjusticiero
Posts: 9
Joined: October 17th, 2023, 9:22 am

Re: Run, save, close: is it possible?

Post by elbitjusticiero »

jsachs wrote: November 15th, 2023, 4:16 pm otherwise every time you recalculated the file you wanted to export, it would create another copy.
Not necessarily, if you configure it to overwrite the file when saving. (If File Exists = Overwrite.)

In any case, it wouldn't necessarily be a bad thing -- creating modified copies of images according to the sequence of instructions in a script is a perfectly good use case for certain workflows.

Thank you for your time! PWP is an awesome program. I'm trying to get ImageMagick to do what I want but I'm struggling with the syntax; also I'll miss the graphical presentation of every step.
jsachs
Posts: 4218
Joined: January 22nd, 2009, 11:03 pm

Re: Run, save, close: is it possible?

Post by jsachs »

It should be relatively easy to add an option to Export to save or save and exit only when running from a script.
Jonathan Sachs
Digital Light & Color
Post Reply