Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

How do I read ScriptUI checkbox values?

$
0
0

From the follow code, how do I read the Boolean of whether a box was checked or not? For each box that's checked, I would like to create a rectangle on the active doc filled with that color. I just can't figure out how to access the user's input. Or am I tackling this problem from the wrong direction?

 

#target Illustrator

myDlg = new Window('dialog', 'Add Pantone Swatches');
myDlg.orientation = 'column';
myDlg.alignment = 'right';

with(myDlg.add('group'))
{
    orientation = 'row';    with(add('panel'))//First structure of Window is materialized    {        orientation = 'column';        add('statictext', undefined, "Please select which swatches to use:");        with(add('group'))        {            orientation = 'column';            for(i=app.activeDocument.swatches.length-1; i !=0; i--){                add('checkbox', undefined, String(app.activeDocument.swatches[i].name));                }                   }    }
}
with(myDlg.add('group'))
{    orientation = 'row';    add('button', undefined, "OK", {name: 'ok'});//Ok and Cancel Buttons    add('button', undefined, "Cancel",{name: 'cancel'});
 }

if(myDlg.show())
{
    if(app.documents.length == 0)        app.documents.add(DocumentColorSpace.CMYK);
}

Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>