in extendscript – Photoshop, I would like my dialog-box check boxes to default to previously used choices … anyone know if this is possible?
in extendscript – Photoshop, I would like my dialog-box check boxes to default to previously used choices … anyone know if this is possible?
3
Answers
You have two choices.
First choice: Using a
//@targetengine
Values can be made persistent over a session using a targetengine.
First script
Second script
If you close Photoshop all of the values will be lost
Second choice: Write to a file.
I wont write an example here. This can be done in so many ways. Plain .txt file. .json file. See this example on how to read and write files.
fabianmoronzirfas has got the right answer.
I will say it could with one script only. That script reads in the previous value stored in a text file in a hardcoded location like C:temp. If the script cannot file the settings file it’ll default to some predetermined value and then store this time around.
Just in case, here is the simple script that saves (and tries to load) your prefs in JSON format to the system temp folder: