Copy link to clipboard
Copied
Is there any way to run a JSX script before the file is saved?
Each time the user clicks the Save command, I would like to save in the XMP data whether the PSD file is saved with compression or not.
By using the Start Save Document event in the Script Events Manager, my script runs right after the save starts, not before. Do you have any idea how to get around it?
Copy link to clipboard
Copied
It is possible to write metadata after the file has been saved: Creating new metadata example in Javascript Tool Guide
P.S. psd compression is a global setting, that is, whether it is enabled or not can be understood and written to metadata at any time long before saving. If the situation allows, then instead of tracking the save operation, you can track the moment the option was switched in the settings.
Copy link to clipboard
Copied
May I ask what the point of the task is?
What is the information intended to be used for?
Copy link to clipboard
Copied
@jazz-y when transferring files between computers I want to recognize whether the file is compressed or not, so tracking a change in compression option globally here won't help.
@c.pfaffenbichler Recognizing whether a file is compressed or not is important to me.
I am using a script that saves the file without compression, but I want to save the final versions of the files with compression.
I need to check if the file is currently compressed.