Set compression level for "save" in script?

Moderator: Kathy_9

Post Reply
pstein
Posts: 110
Joined: Wed Dec 28, 2011 7:09 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP X2
Location: Germany/Canada

Set compression level for "save" in script?

Post by pstein »

In a script I setup (after another modification) a "save" operation (with overwrite of the original *.jpg photo file).

I thought that for this "save" operation the same compression level is taken as if I would manually do a "save as....", click "Options" and set a compression Factor of "3".

This seems (by far !) not the case.

When I apply the script (in a batch processing) onto some *.jpg photo files they are saved with a strong compression factor and not with the current tiny compression of 3.

I checked it by performing the same operations manually.

So which compression factor is taken then otherwise?
Where can I change it (in preferences)?

How can I set the compression factor in script?

Thank you
Peter
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Set compression level for "save" in script?

Post by LeviFiction »

Use SaveAs to set the compression level in the script and set it's execution mode to silent. This is similar to using Save but gives you more control
https://levifiction.wordpress.com/
pstein
Posts: 110
Joined: Wed Dec 28, 2011 7:09 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSP X2
Location: Germany/Canada

Re: Set compression level for "save" in script?

Post by pstein »

LeviFiction wrote:Use SaveAs to set the compression level in the script and set it's execution mode to silent. This is similar to using Save but gives you more control
How do I set "execution mode to silent"?

In the Save options dialog of "SaveAs" there is no such parameter (checkbox?).

Can I directly add it textually in Script file?
How?

Peter
Kathy_9
Site Admin
Posts: 2896
Joined: Tue Nov 30, 2010 12:44 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 8th Generation Intel Core i7 8700 3 20 GHz
ram: 16GB
Video Card: NVIDIA GeForce RTX 2060 [6 GB GDDR6 dedicated]
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2TB
Monitor/Display Make & Model: HP EliteDisplay E243m 23.8-inch
Corel programs: PSPX2 ~2023; Painter 2018~23
Location: USA
Contact:

Re: Set compression level for "save" in script?

Post by Kathy_9 »

pstein wrote: How do I set "execution mode to silent"?
It's located on the Scripts toolbar.
click for larger image
click for larger image
PSPX9 | PSP2020 | PSP2021| PSP2022 | PSP2023 & PhotoMirage installed; PSPX | PSPX2 thru PSP2019 owned but not installed
http://www.flickr.com/photos/37153430@N03/
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Set compression level for "save" in script?

Post by LeviFiction »

That is the easiest option. But it's the least flexible. It forces the entire script to run silently or interactively.

You can also set specific commands in a recorded script to run silently using the simple script editor built into PSP. Or by manually editing the script. This allows you to create a script where specific commands run interactively, others silently, and still others according to the interactive setting on the script toolbar for ultimate flexibility in script execution.

Setting the entire script to run silently from the script toolbar is nice when you want the option to turn it on or off at will. But if you always want the command to run silently regardless of that setting, you need to change the command's execution mode from Default to Silent.

On your script toolbar, since you're using PSPP X2 It might look a little different, you'll see a button with a piece of paper and something writing on it. In this image, it's a pencil, but if I remember X2 correctly I think it uses the older quill icon. It's the same button. This is the button that opens the script in the script editor.
scripttoolbaredit.JPG
If the script was recorded by PSP and is correctly formatted with no extra functionality at all, PSP will use its own built-in simple script editor. As shown below. If the script has been manually edited then PSP will open it in whatever editor you have set in the File Locations. By default, this is normal Notepad.
ScritpEditor.JPG
In the simple script editor, you can see a list of all commands run by the script. If you can edit the command you can double click on it to change the parameters. If you can't edit it you'll see "Not Editable" next to the command name. Each command has a checkmark as the first option. This turns the command on or off. If it's off it won't execute at all. This is a quick way to check what part of your script is causing issues or how a script will look if you remove a step or two without having to manually delete commands or re-record the script.

The next option is a drop-down. This lets you set the execution mode. Your options are Default (will use the script toolbar execution mode), Interactive (Will always show a dialog box and confirmation message), or Silent (will always suppress the dialog and assume permission has been given to execute the command).

You can also open the script in your set text editor by clicking the "Text Editor" box if you want to add more logic to the script.

IF your script opens in Notepad from the get-go, you can easily set the command to run silently by finding the "GeneralSettings" parameter of the command. In your other request about resizing you can see an example of the GeneralSettings. This has a parameter called "ExecutionMode".

Code: Select all

'ExecutionMode': App.Constants.ExecutionMode.Default, 
Simply change the last word from Default to Interactive or Silent to change how the script executes.

Code: Select all

'ExecutionMode': App.Constants.ExecutionMode.Silent, #This executes silently
https://levifiction.wordpress.com/
Post Reply