So I have a few scripts that are designed to act on the currently open document.
Some of them by nature are pretty destructive to the document because they're designed to do some crazy stuff.
So, when the user runs the script, I'm currently presenting them with a "confirm" dialog with a blurb explaining that they should make sure to save the document before running the script (so they can always return to the previous state).
Anyway, one of my co-workers was complaining about have to see this dialog every time they run the script, as well as some other alerts I use when there are errors.
So, there's basically 3 dialogs the user will see:
1. Confirm (Did you save your stuff, first?)
2. Script Parameters (ScriptUI controls to adjust the various script settings)
3. Success/Error messages
Is there a way to add a "don't show this again" checkbox to the confirm modal dialog so that it would only show the first time the script is run (per session)?
I can probably hide the Success/Error alerts by just adding a checkbox in the ScriptUI dialog, which would obviously set a variable, but in order to keep the confirm prompt from showing the next time they run the script, I would imagine I'd have to store a "cookie" type object on the users local drive? Is that possible?
You don't need a cookie… A plain text file somewhere should do you… If you were to write in the Folder.temp directory it should be flushed at computer restart… ( or so I think not checked that )