@pkrk – can you give us a more precise description? And some code?
Who or what wants to duplicate a swatch?
The user in the UI? Your script?
If the user in the UI, do you have created a ScriptUI Panel with some functionality that is visible in the UI while the user is doing "normal" layout work in InDesign? And if yes, why do you prevent the user from seeing alert messages setting the userInteractionLevel to NEVER_INTERACT?
What exact version of InDesign on what exact version of OS is this script running?
This is the message that I want the script to say yes to or else it doesn't duplicate when I do
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
//Creative Cloud - OS X.8.5
myDocument = app.activeDocument;
mySwatches = new Array();
//There are more steps after the fact that rename the swatches and do some other steps which is why I don't want the user being asked. I just want the "PANTONE" swatches duplicated.
Ah. Now I begin to understand…
You want to suppress the message when duplicating the swatch.
And you tried with userInteractionLevel set to NEVER_INTERACT.
What obviously does not work.
So you want the script answer the alert dialog with "Yes".
Hm; not my realm, but maybe this would be possible with an AppleScript.
On the other hand, why duplicating an existing swatch?
What is the benefit?
To change some properties after duplicating? Like name, color values etc.?
You could do that with adding a swatch to the document with the add() method.
hmmm... "add" may be the ticket. I can add the new color and copy the properties of the pantone(hopefully).
The names of the pantones have to change for a workflow. Color might change sometimes.
I'll try it out and post back. If someone has a way to say yes to the dialog I would still like to try that.
At the moment, adding a color doesn't seem like it will work for this scenaraio since I will want to get color of the pantone and name it something else.
I'll need to find how to say yes to the dialog.
Add a swatch and copying the properties worked for me.
Can you share a code snippet?