ScriptUI Graphics

The foreground and background color in ScriptUI.graphics seem to be a little confusing.
on all controls you can set foreground color, but it doesn't actually work on window, button, radiobutton, checkbox, treeview, group
backgroundColor can not be set for button,iconbutton,radiobutton, checkbox, treeview
didn't check everything, but is there a way around this. Also I'm testing CS3, has this changed cs4
Thanks

[email protected] wrote:
> And I Have Not Been Able To Find A Control That Displays Disabled Background Or Disabled Foreground Color
You have documentation for features that don't exist.
Consider yourself lucky!
Usually we don't have documentation for features that do exist.
-X

Similar Messages

  • ScriptUI Graphics - Listbox question

    Is there a way to have the rows in a list box have alternating background color?
    I've figured out how to change the background and font as a whole on the Listbox but changing it for every item you add into the Listbox is evading me.
    Anyone know how?   Thanks in advance.

    damn, ok!
    Well that solves that issue
    Not a big deal, was just hoping it could be done to spruce up the UI I am building a little bit.  Not a major need for function
    Thanks guys

  • Now draw your own ScriptUIGraphics graphics! (1st testing)

    Hey everyone, I've made this little system of drawing ScriptUIGraphics from your illustrator document.  Please be advised, the graphics resulting from this are not anti-aliased and look bad at medium sizes --> terrible at small sizes, but they may help with making some dynamic icons for some really specific scriptUI purposes.
    Basically, you just draw something in an AI doc, run this window and use the function from it as well as the object resource string to recreate that drawing in your own scriptUI windows.
    This method only uses straight lines and ellipses when it detects ellipses.  After seeing the quality of these drawings, I'm thinking for the prettier icons you'd surely want to embed images into your UI, but there may come a very very rare time when there exists a need for some dynamic image with many states, so this may be what it may end up perhaps being useful for.
    Attached are screenshots with original drawing (artboard is 100x100px), the captured image drawn in window and last, pretty much the same- is the result drawn from object resource string.  The screenshots JPEGs have smoothed out the little icons, making them look actually better than they really are!
    Edit: 
         Oh yes, I did need to mention: the colors used can be any color, spot/Lab included!  They just get changed to some version of RGB for rendering.
    // ScriptUI Graphics Display by Vasily
    function graphicsDisplay(){
        function itemShape(myShape){
            // Going to test for circles.
            var shapeKind={
                isrectangle: null,
                iscircle: null,
                isellipse: null
            if(myShape.typename=='PathItem' && myShape.pathPoints.length == 4){ // RECTANGLE CHECKER
                //--------------------2 diagonals-------------------------
                var recEquaDistOne = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[2].anchor[1]),2)); // diagonal
                var recEquaDistTwo = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[3].anchor[1]),2)); // diagonal
                //---------------------4 sides of rectangle---------------
                var sideA = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[1].anchor[0]),2) +
                Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[1].anchor[1]),2)); 
                var sideB = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[2].anchor[1]),2)); 
                var sideC = parseInt(Math.pow((myShape.pathPoints[2].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                Math.pow((myShape.pathPoints[2].anchor[1] - myShape.pathPoints[3].anchor[1]),2)); 
                var sideD = parseInt(Math.pow((myShape.pathPoints[3].anchor[0] - myShape.pathPoints[0].anchor[0]),2) +
                Math.pow((myShape.pathPoints[3].anchor[1] - myShape.pathPoints[0].anchor[1]),2)); 
                if(recEquaDistOne == recEquaDistTwo){ // If two diagonals connecting opposite points are same length, it's a 90 degree box               
                    if((sideA == sideC) && (sideB == sideD)){
                        for(var j=0; j<4; j++){
                            var point = myShape.pathPoints[j];             
                                if((point.leftDirection[0] == point.anchor[0]) &&
                                    (point.anchor[0] == point.rightDirection[0]) &&
                                    (point.leftDirection[1] == point.anchor[1]) &&
                                    (point.anchor[1] == point.rightDirection[1])){                                                   
                                    shapeKind.isrectangle = true;
                                } else {
                                    shapeKind.isrectangle = false;
                                    break;
                if(myShape.pathPoints.length == 4){  // CIRCLE CHECKER
                    if(shapeKind.isrectangle == false || shapeKind.isrectangle == null){
                        var circlePts = new Array();
                        var circleSlopes = new Array();
                        for (k=0; k<4; k++){
                        var point = myShape.pathPoints[k]; 
                        var leftHandleDist = parseInt(Math.pow((point.leftDirection[0] - point.anchor[0]),2) +
                        Math.pow((point.leftDirection[1] - point.anchor[1]),2));
                        var rightHandleDist = parseInt(Math.pow((point.rightDirection[0] - point.anchor[0]),2) +
                        Math.pow((point.rightDirection[1] - point.anchor[1]),2));
                        circlePts.push(leftHandleDist, rightHandleDist);
                        var leftHandleSlope = ((point.leftDirection[0] - point.anchor[0])/(point.leftDirection[1] - point.anchor[1])).toFixed(2);
                        var rightHandleSlope = ((point.rightDirection[0] - point.anchor[0])/(point.rightDirection[1] - point.anchor[1])).toFixed(2);
                        circleSlopes.push(leftHandleSlope, rightHandleSlope);
                    for(var f=0; f<8; f++){ // Allows non-rotated circles.
                        if(circleSlopes[f] == "-0.00"){
                            circleSlopes[f] = "0.00";
                        if(circleSlopes[f] == "-Infinity"){
                            circleSlopes[f] = "Infinity";
                    var cirEquaDistOne = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                    Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[2].anchor[1]),2));
                    var cirEquaDistTwo = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                    Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[3].anchor[1]),2));
                    if(circleSlopes[0] != "NaN"){ // Filters out asymmetric rhombus  <><><>^^^^^^<><><>
                        if((circlePts[0] == circlePts[1]) && // Filters out shapes with control handles not of equal distance from anchor point.
                            (circlePts[1] == circlePts[2]) &&
                            (circlePts[2] == circlePts[3]) &&
                            (circlePts[3] == circlePts[4]) &&
                            (circlePts[4] == circlePts[5]) &&
                            (circlePts[5] == circlePts[6]) &&
                            (circlePts[6] == circlePts[7]) &&
                            (circlePts[7] == circlePts[0])){
                            if((circleSlopes[0] == circleSlopes[1]) && // Filters out the equadistant 4-pointed Star shape (dismisses negative slopes).
                                (circleSlopes[2] == circleSlopes[3]) &&
                                (circleSlopes[4] == circleSlopes[5]) &&
                                (circleSlopes[6] == circleSlopes[7])){
                                if(cirEquaDistOne == cirEquaDistTwo){ // Filters out Ellipses (non-equadistant circles).
                                    // Filters out the very RARE 4-pointed star which has all control points in its center on top of each other!
                                    if(((myShape.pathPoints[0].leftDirection[0]).toFixed(2) != (myShape.pathPoints[1].leftDirection[0]).toFixed(2)) &&
                                        ((myShape.pathPoints[0].leftDirection[1]).toFixed(2) != (myShape.pathPoints[1].leftDirection[1]).toFixed(2))){
                                        shapeKind.iscircle = true;
                                    } else {
                                        shapeKind.iscircle = false;
                        } else {
                            if((circlePts[0]==circlePts[1]) &&
                                (circlePts[2]==circlePts[3]) &&
                                ((circlePts[4]==circlePts[5]) && (circlePts[4]==circlePts[1]) && (circlePts[5]==circlePts[1])) &&
                                ((circlePts[6]==circlePts[7]) && (circlePts[6]==circlePts[2]) && (circlePts[7]==circlePts[3]))){
                                shapeKind.isellipse=true;
        //~                     $.writeln(circlePts[0]+'\r'+circlePts[1]+'\r'+circlePts[2]+'\r'+circlePts[3]+'\r'+
        //~                     circlePts[4]+'\r'+circlePts[5]+'\r'+circlePts[6]+'\r'+circlePts[7]);
            return shapeKind;
        if(app.name=='Adobe Illustrator' && app.documents.length>0){
            function round2(num){
                return Math.round(num*100)/100;
            function convertToUIRGB(color){
                if(color=='[CMYKColor]'){
                    var c=color.cyan, m=color.magenta, y=color.yellow, k=color.black;
                    return [
                        round2((1-(c/100))*(1-(k/100))),
                        round2((1-(m/100))*(1-(k/100))),
                        round2((1-(y/100))*(1-(k/100)))
                } else if(color=='[GrayColor]'){
                    var k=color.gray;
                    var grayValue=1-(Math.round(((k/100)*255)*100)/100)/255;
                    return [grayValue,grayValue,grayValue];
                } else if(color=='[GradientColor]'){
                    $.writeln('Sorry, no gradient colors please.');
                    return [0,0,0];
                } else if(color=='[PatternColor]'){
                    $.writeln('Sorry, no pattern colors please.');
                    return [0,0,0,];
                } else if(color=='[SpotColor]'){
                    var clr=color.spot.getInternalColor();
                    if(color.spot.spotKind==SpotColorKind.SPOTCMYK){
                        var c=clr[0], m=clr[1], y=clr[2], k=clr[3];
                        return [
                            round2((1-(c/100))*(1-(k/100))),
                            round2((1-(m/100))*(1-(k/100))),
                            round2((1-(y/100))*(1-(k/100)))
                    } else if(color.spot.spotKind==SpotColorKind.SPOTRGB){
                        return [round2(clr[0]/255), round2(clr[1]/255), round2(clr[2]/255)];
                    } else if(color.spot.spotKind==SpotColorKind.SPOTLAB){
                        var clr=color.spot.getInternalColor();
                        var whiteRef={
                            D65: {X: 95.047,Y: 100, Z: 108.883},
                            D50: {X: 96.422,Y: 100, Z: 82.521},
                        var illuminant='D65';
                        var Y = (clr[0]+16)/116;
                        var X = clr[1]/500+Y;
                        var Z = Y-clr[2]/200;
                        if(Math.pow(Y,3) > 0.008856){Y=Math.pow(Y,3);}
                        else {Y = (Y-16/116)/7.787;}
                        if(Math.pow(X,3) > 0.008856){X=Math.pow(X,3);}
                        else {X = (X-16/116)/7.787;}
                        if(Math.pow(Z,3) > 0.008856){Z=Math.pow(Z,3);}
                        else {Z = (Z-16/116)/7.787;}
                        X*=whiteRef[illuminant].X,Y*=whiteRef[illuminant].Y,Z*=whiteRef[illuminant].Z;
                        //alert(X+" "+Y+" "+Z);
                        X/=100,Y/=100,Z/=100;
                        R=X*3.2406+Y*-1.5372+Z*-0.4986;
                        G=X*-0.9689+Y*1.8758+Z*0.0415;
                        B=X*0.0557+Y*-0.2040+Z*1.0570;
                        //alert(R+" "+G+" "+B);
                        if(R > 0.0031308){R=(1.055*(Math.pow(R,(1/2.4))))-0.055;}
                        else {R*= 12.92;}
                        if(G > 0.0031308){G=(1.055*(Math.pow(G,(1/2.4))))-0.055;}
                        else {G*= 12.92;}
                        if(B > 0.0031308){B=(1.055*(Math.pow(B,(1/2.4))))-0.055;}
                        else {B*= 12.92;}
                        if(R<0){R=0} else if(R>1){R=1};
                        if(G<0){G=0} else if(G>1){G=1};
                        if(B<0){B=0} else if(B>1){B=1};
                        return [round2(R),round2(G),round2(B)];
                } else if(color=='[RGBColor]'){
                    return [round2(color.red/255), round2(color.green/255), round2(color.blue/255)];
            function drawFromObjString(objString, canvasArea){
               function round2(num){
                   return Math.round(num*100)/100;
                var obj=eval(objString);
                var canvas=canvasArea.graphics;
                var counter=obj.total;
                while(counter>=0){
                    for(all in obj){
                        if(all.match(/\d{1,2}$/g) && all.match(/\d{1,2}$/g)==counter){
                            var thisShp=obj[all];
                            if(thisShp.ellipsePath!=true){
                                var vectorPts=thisShp.pathPoints;
                                canvas.newPath(); canvas.moveTo(thisShp.pathPoints[0][0],thisShp.pathPoints[0][1]);
                                for(var j=0; j<vectorPts.length; j++){
                                    var thisAnchor=vectorPts[j];
                                    var x=thisAnchor[0], y=thisAnchor[1];
                                    canvas.lineTo(x,y);
                                if(thisShp.closed==true){
                                    canvas.closePath();
                            } else {
                                var cirPts=thisShp.pathPoints;
                                canvas.newPath();
                                canvas.ellipsePath(cirPts[0], cirPts[1], cirPts[2], cirPts[3]);
                                canvas.closePath();
                            if(thisShp.fillColor!=null){
                                var clr=thisShp.fillColor;
                                var myBrush=canvas.newBrush(canvas.BrushType.SOLID_COLOR,clr);
                                canvas.fillPath(myBrush);
                            if(thisShp.strokeColor!=null){
                                var clr=thisShp.strokeColor;
                                var myPen=canvas.newPen(canvas.PenType.SOLID_COLOR,[clr[0],clr[1],clr[2],1], thisShp.strokeWidth);
                                canvas.strokePath(myPen);
                    counter-=1;
            var doc=app.activeDocument;
            if(doc.height<=400 && doc.width<=600){
                doc.rulerOrigin=[0,doc.height];
                doc.coordinateSystem=CoordinateSystem.DOCUMENTCOORDINATESYSTEM;
                var wDims=function(){
                    var dims={width: '', height: ''};
                    if(doc.width>220){
                        dims.width = Math.round(doc.width);
                    } else {
                        dims.width = 220;
                    if(doc.height>20){
                        dims.height = Math.round(doc.height);
                    } else {
                        dims.height = 20;
                    return dims;
                function drawCapture(vectors, dataDisplay, graphicDisplay){
                    // draws a preview and creates a drawing data object resource.
                    var drawData={total:0}; //Put drawing shapes here.  Properties: stroke (rgb color | null), fill (rgb color | null), pathPoints
                    var canvas=graphicDisplay.graphics;
                    for(var i=vectors.length-1; i>-1; i--){
                        var thisShp=vectors[i];
                        if((thisShp.filled || thisShp.stroked) && thisShp.editable==true){
                            drawData.total++;
                            drawData['shape_'+i]={};
                            drawData['shape_'+i].fillColor=null;
                            drawData['shape_'+i].strokeColor=null;
                            drawData['shape_'+i].pathPoints=[];
                            drawData['shape_'+i].ellipsePath=false;
                            if(itemShape(thisShp).iscircle==true || itemShape(thisShp).isellipse==true || thisShp.name=='ellipse' ||
                                thisShp.name=='circle' || thisShp.name=='cir'){
                                drawData['shape_'+i].ellipsePath=true;
                                drawData['shape_'+i].pathPoints=[thisShp.left, -thisShp.top, thisShp.width, thisShp.height];
                                canvas.newPath();
                                canvas.ellipsePath(thisShp.left, -thisShp.top, thisShp.width, thisShp.height);
                            } else {
                                var vectorPts=thisShp.pathPoints;
                                canvas.newPath(); canvas.moveTo(Math.round(vectorPts[0].anchor[0]),-Math.round(vectorPts[0].anchor[1]));
                                for(var j=0; j<vectorPts.length; j++){
                                    var thisAnchor=vectorPts[j].anchor;
                                    var x=Math.round(thisAnchor[0]), y=-Math.round(thisAnchor[1]);
                                    drawData['shape_'+i].pathPoints.push([x,y]);
                                    canvas.lineTo(x,y);
                            if(thisShp.closed || drawData['shape_'+i].ellipsePath==true){
                                drawData['shape_'+i].closed=true;
                                if(drawData['shape_'+i].ellipsePath!=true){
                                    canvas.closePath();
                            } else {
                                drawData['shape_'+i].closed=false;
                            if(thisShp.filled){
                                var clr=thisShp.fillColor;
                                var colorArray=convertToUIRGB(clr);
                                var myBrush=canvas.newBrush(canvas.BrushType.SOLID_COLOR,colorArray);
                                drawData['shape_'+i].fillColor=colorArray;
                                canvas.fillPath(myBrush);
                            if(thisShp.stroked){
                                var clr=thisShp.strokeColor;
                                var colorArray=convertToUIRGB(clr);
                                var myPen=canvas.newPen(canvas.PenType.SOLID_COLOR,[colorArray[0],colorArray[1],colorArray[2],1], Math.round(thisShp.strokeWidth));
                                drawData['shape_'+i].strokeColor=colorArray;
                                drawData['shape_'+i].strokeWidth=Math.round(thisShp.strokeWidth);
                                canvas.strokePath(myPen);
                    return drawData;
                function showDrawerFunc(objStringDisplay, wDims){
                    var w2=new Window('dialog','Drawer Function');
                    var containerG=w2.add('tabbedpanel');
                        var funcG=containerG.add('tab',undefined,'Drawer Function');
                            var dispE=funcG.add('edittext',undefined,funcSrc,{multiline:true}); dispE.size=[580,200];
                            var selBtn=funcG.add('button',undefined,'Select All');
                        var drawingG=containerG.add('tab',undefined,'Drawing:');
                            var drawG=drawingG.add('group');
                                var drawP=drawG.add('panel',undefined,''); drawP.size=[wDims.width, wDims.height];
                    var msgCntr=w2.add('panel',undefined,'Message Center:');
                        var msgE=msgCntr.add('edittext',undefined,'',{multiline:true});msgE.size=[560,40];
                    var btnG=w2.add('group');
                        var okBtn=btnG.add('button',undefined,'Ok',{name: 'ok'});
                    selBtn.onClick=function(){
                        dispE.active=false; dispE.active=true;
                    drawG.onDraw=function(){
                        if(objStringDisplay.text!=''){
                            try{
                                drawFromObjString(objStringDisplay.text, this);
                            } catch(e){
                                msgE.text=("Something isn't right:\r"+e);
                        } else {
                            msgE.text=('You must first put a valid object string into the object string display area--> "Get Source Object String" button, 1st window, 1st tab.');
                    w2.show();
                function instructions(){
                    var w3=new Window('dialog','instructions');
                    var instructions=w3.add('edittext',undefined,'',{multiline:true}); instructions.size=[400,100];
                    instructions.text="1)  Have a document open, smaller than 600x400.\r\r"+
                        "2)  Draw some stuff- use paths only, straight lines or ellipses only. To have script explicitly recognize ellipse, "+
                        "label the path 'cir', 'circle', or 'ellipse'. Right now there's a function to detect ellipses, but it is coarse.\r\r"+
                        "3)  Run this script and see if your drawing was captured below this box.\r\r"+
                        "4)  Click the 'Get Object String' button and see the drawing instruction string appear.\r\r"+
                        "5)  Click the 'View Drawer Function/Drawing' button to see the function used to draw scriptUI picture from"+
                        " the object string and use other tab to see the drawing made with this function from that object string.\r\r"+
                        "6)  Edit your string to see your picture change if needed!";
                    var okBtn=w3.add('button',undefined,'OK');
                    w3.show();
                var funcSrc=drawFromObjString.toSource();
                var dispWindow=function(){
                    var drawData;
                    var w=new Window('dialog','ScriptUI Graphics Display');
                    var panel=w.add('panel',undefined,''); panel.size=[wDims.width+6,wDims.height+6];
                    var list=w.add('edittext',undefined,'',{multiline:true}); list.size=[wDims.width,150];
                    var btnsG=w.add('group');
                        var clickBtn=btnsG.add('button',undefined,'Get Source Object String');
                        var selectBtn=btnsG.add('button',undefined,'Select All');
                    var btnG2=w.add('group');
                        var funcBtn=btnG2.add('button',undefined,'See Drawer Function/Drawing');
                        funcBtn.helpTip='Uses the Object String picture info to draw using ScriptUIGraphics lineTo commands.';
                        var helpBtn=btnG2.add('button',undefined,'?'); helpBtn.size=[25,25];
                    panel.onDraw=function(){
                        drawData=drawCapture(doc.pathItems, list, this);
                    clickBtn.addEventListener('mousedown',function(){
                        list.text=drawData.toSource();
                    funcBtn.onClick=function(){
                        showDrawerFunc(list, wDims);
                    helpBtn.onClick=function(){
                        instructions();
                    selectBtn.onClick=function(){
                        list.active=false; list.active=true;
                    var okBtn=w.add('button',undefined,'OK');
                    w.show();
            } else {
                alert('Please use a document with main artboard no larger than 600x400.');
        } else {
            alert('Must run in Illustrator with at least 1 document open.');
    graphicsDisplay();

    New-er update to this:
    // ScriptUI Graphics Display by Vasily
    #target illustrator
    function graphicsDisplay(){
        function itemShape(myShape){
            // Going to test for circles.
            var shapeKind={
                isrectangle: null,
                iscircle: null,
                isellipse: null
            if(myShape.typename=='PathItem' && myShape.pathPoints.length == 4){ // RECTANGLE CHECKER
                //--------------------2 diagonals-------------------------
                var recEquaDistOne = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[2].anchor[1]),2)); // diagonal
                var recEquaDistTwo = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[3].anchor[1]),2)); // diagonal
                //---------------------4 sides of rectangle---------------
                var sideA = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[1].anchor[0]),2) +
                Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[1].anchor[1]),2)); 
                var sideB = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[2].anchor[1]),2)); 
                var sideC = parseInt(Math.pow((myShape.pathPoints[2].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                Math.pow((myShape.pathPoints[2].anchor[1] - myShape.pathPoints[3].anchor[1]),2)); 
                var sideD = parseInt(Math.pow((myShape.pathPoints[3].anchor[0] - myShape.pathPoints[0].anchor[0]),2) +
                Math.pow((myShape.pathPoints[3].anchor[1] - myShape.pathPoints[0].anchor[1]),2)); 
                if(recEquaDistOne == recEquaDistTwo){ // If two diagonals connecting opposite points are same length, it's a 90 degree box               
                    if((sideA == sideC) && (sideB == sideD)){
                        for(var j=0; j<4; j++){
                            var point = myShape.pathPoints[j];             
                                if((point.leftDirection[0] == point.anchor[0]) &&
                                    (point.anchor[0] == point.rightDirection[0]) &&
                                    (point.leftDirection[1] == point.anchor[1]) &&
                                    (point.anchor[1] == point.rightDirection[1])){
                                    shapeKind.isrectangle = true;
                                } else {
                                    shapeKind.isrectangle = false;
                                    break;
                if(myShape.pathPoints.length == 4){  // CIRCLE CHECKER
                    if(shapeKind.isrectangle == false || shapeKind.isrectangle == null){
                        var circlePts = new Array();
                        var circleSlopes = new Array();
                        for (k=0; k<4; k++){
                        var point = myShape.pathPoints[k]; 
                        var leftHandleDist = parseInt(Math.pow((point.leftDirection[0] - point.anchor[0]),2) +
                        Math.pow((point.leftDirection[1] - point.anchor[1]),2));
                        var rightHandleDist = parseInt(Math.pow((point.rightDirection[0] - point.anchor[0]),2) +
                        Math.pow((point.rightDirection[1] - point.anchor[1]),2));
                        circlePts.push(leftHandleDist, rightHandleDist);
                        var leftHandleSlope = ((point.leftDirection[0] - point.anchor[0])/(point.leftDirection[1] - point.anchor[1])).toFixed(2);
                        var rightHandleSlope = ((point.rightDirection[0] - point.anchor[0])/(point.rightDirection[1] - point.anchor[1])).toFixed(2);
                        circleSlopes.push(leftHandleSlope, rightHandleSlope);
                    for(var f=0; f<8; f++){ // Allows non-rotated circles.
                        if(circleSlopes[f] == "-0.00"){
                            circleSlopes[f] = "0.00";
                        if(circleSlopes[f] == "-Infinity"){
                            circleSlopes[f] = "Infinity";
                    var cirEquaDistOne = parseInt(Math.pow((myShape.pathPoints[0].anchor[0] - myShape.pathPoints[2].anchor[0]),2) +
                    Math.pow((myShape.pathPoints[0].anchor[1] - myShape.pathPoints[2].anchor[1]),2));
                    var cirEquaDistTwo = parseInt(Math.pow((myShape.pathPoints[1].anchor[0] - myShape.pathPoints[3].anchor[0]),2) +
                    Math.pow((myShape.pathPoints[1].anchor[1] - myShape.pathPoints[3].anchor[1]),2));
                    if(circleSlopes[0] != "NaN"){ // Filters out asymmetric rhombus  <><><>^^^^^^<><><>
                        if((circlePts[0] == circlePts[1]) && // Filters out shapes with control handles not of equal distance from anchor point.
                            (circlePts[1] == circlePts[2]) &&
                            (circlePts[2] == circlePts[3]) &&
                            (circlePts[3] == circlePts[4]) &&
                            (circlePts[4] == circlePts[5]) &&
                            (circlePts[5] == circlePts[6]) &&
                            (circlePts[6] == circlePts[7]) &&
                            (circlePts[7] == circlePts[0])){
                            if((circleSlopes[0] == circleSlopes[1]) && // Filters out the equadistant 4-pointed Star shape (dismisses negative slopes).
                                (circleSlopes[2] == circleSlopes[3]) &&
                                (circleSlopes[4] == circleSlopes[5]) &&
                                (circleSlopes[6] == circleSlopes[7])){
                                if(cirEquaDistOne == cirEquaDistTwo){ // Filters out Ellipses (non-equadistant circles).
                                    // Filters out the very RARE 4-pointed star which has all control points in its center on top of each other!
                                    if(((myShape.pathPoints[0].leftDirection[0]).toFixed(2) != (myShape.pathPoints[1].leftDirection[0]).toFixed(2)) &&
                                        ((myShape.pathPoints[0].leftDirection[1]).toFixed(2) != (myShape.pathPoints[1].leftDirection[1]).toFixed(2))){
                                        shapeKind.iscircle = true;
                                    } else {
                                        shapeKind.iscircle = false;
                        } else {
                            if((circlePts[0]==circlePts[1]) &&
                                (circlePts[2]==circlePts[3]) &&
                                ((circlePts[4]==circlePts[5]) && (circlePts[4]==circlePts[1]) && (circlePts[5]==circlePts[1])) &&
                                ((circlePts[6]==circlePts[7]) && (circlePts[6]==circlePts[2]) && (circlePts[7]==circlePts[3]))){
                                shapeKind.isellipse=true;
        //~                     $.writeln(circlePts[0]+'\r'+circlePts[1]+'\r'+circlePts[2]+'\r'+circlePts[3]+'\r'+
        //~                     circlePts[4]+'\r'+circlePts[5]+'\r'+circlePts[6]+'\r'+circlePts[7]);
            return shapeKind;
        if(app.name=='Adobe Illustrator' && app.documents.length>0){
            function round2(num){
                return Math.round(num*100)/100;
            function convertToUIRGB(color){
                if(color=='[CMYKColor]'){
                    var c=color.cyan, m=color.magenta, y=color.yellow, k=color.black;
                    return [
                        round2((1-(c/100))*(1-(k/100))),
                        round2((1-(m/100))*(1-(k/100))),
                        round2((1-(y/100))*(1-(k/100)))
                } else if(color=='[GrayColor]'){
                    var k=color.gray;
                    var grayValue=1-(Math.round(((k/100)*255)*100)/100)/255;
                    return [grayValue,grayValue,grayValue];
                } else if(color=='[GradientColor]'){
                    $.writeln('Sorry, no gradient colors please.');
                    return [0,0,0];
                } else if(color=='[PatternColor]'){
                    $.writeln('Sorry, no pattern colors please.');
                    return [0,0,0,];
                } else if(color=='[SpotColor]'){
                    var clr=color.spot.getInternalColor();
                    if(color.spot.spotKind==SpotColorKind.SPOTCMYK){
                        var c=clr[0], m=clr[1], y=clr[2], k=clr[3];
                        return [
                            round2((1-(c/100))*(1-(k/100))),
                            round2((1-(m/100))*(1-(k/100))),
                            round2((1-(y/100))*(1-(k/100)))
                    } else if(color.spot.spotKind==SpotColorKind.SPOTRGB){
                        return [round2(clr[0]/255), round2(clr[1]/255), round2(clr[2]/255)];
                    } else if(color.spot.spotKind==SpotColorKind.SPOTLAB){
                        var clr=color.spot.getInternalColor();
                        var whiteRef={
                            D65: {X: 95.047,Y: 100, Z: 108.883},
                            D50: {X: 96.422,Y: 100, Z: 82.521},
                        var illuminant='D65';
                        var Y = (clr[0]+16)/116;
                        var X = clr[1]/500+Y;
                        var Z = Y-clr[2]/200;
                        if(Math.pow(Y,3) > 0.008856){Y=Math.pow(Y,3);}
                        else {Y = (Y-16/116)/7.787;}
                        if(Math.pow(X,3) > 0.008856){X=Math.pow(X,3);}
                        else {X = (X-16/116)/7.787;}
                        if(Math.pow(Z,3) > 0.008856){Z=Math.pow(Z,3);}
                        else {Z = (Z-16/116)/7.787;}
                        X*=whiteRef[illuminant].X,Y*=whiteRef[illuminant].Y,Z*=whiteRef[illuminant].Z;
                        //alert(X+" "+Y+" "+Z);
                        X/=100,Y/=100,Z/=100;
                        R=X*3.2406+Y*-1.5372+Z*-0.4986;
                        G=X*-0.9689+Y*1.8758+Z*0.0415;
                        B=X*0.0557+Y*-0.2040+Z*1.0570;
                        //alert(R+" "+G+" "+B);
                        if(R > 0.0031308){R=(1.055*(Math.pow(R,(1/2.4))))-0.055;}
                        else {R*= 12.92;}
                        if(G > 0.0031308){G=(1.055*(Math.pow(G,(1/2.4))))-0.055;}
                        else {G*= 12.92;}
                        if(B > 0.0031308){B=(1.055*(Math.pow(B,(1/2.4))))-0.055;}
                        else {B*= 12.92;}
                        if(R<0){R=0} else if(R>1){R=1};
                        if(G<0){G=0} else if(G>1){G=1};
                        if(B<0){B=0} else if(B>1){B=1};
                        return [round2(R),round2(G),round2(B)];
                } else if(color=='[RGBColor]'){
                    return [round2(color.red/255), round2(color.green/255), round2(color.blue/255)];
            function drawFromObjString(objString, canvasArea){
                function drawPath(shp){
                    var thisShp=shp;
                    if(thisShp.ellipsePath!=true){
                        var vectorPts=thisShp.pathPoints;
                        canvas.newPath(); canvas.moveTo(thisShp.pathPoints[0][0],thisShp.pathPoints[0][1]);
                        for(var j=0; j<vectorPts.length; j++){
                            var thisAnchor=vectorPts[j];
                            var x=thisAnchor[0], y=thisAnchor[1];
                            canvas.lineTo(x,y);
                        if(thisShp.closed==true){
                            canvas.closePath();
                    } else {
                        var cirPts=thisShp.pathPoints;
                        canvas.newPath();
                        canvas.ellipsePath(round2(cirPts[0]), round2(cirPts[1]), round2(cirPts[2]), round2(cirPts[3]));
                        canvas.closePath();
                    if(thisShp.fillColor!=null){
                        var clr=thisShp.fillColor;
                        var myBrush=canvas.newBrush(canvas.BrushType.SOLID_COLOR,clr);
                        canvas.fillPath(myBrush);
                    if(thisShp.strokeColor!=null){
                        var clr=thisShp.strokeColor;
                        var myPen=canvas.newPen(canvas.PenType.SOLID_COLOR,[clr[0],clr[1],clr[2],1], thisShp.strokeWidth);
                        canvas.strokePath(myPen);
            //$.writeln(objString.replace(/'\+\n*\r*'/g,'').replace(/(^'|';$)/g,''));
                var obj=eval(objString.replace(/'\+\n*\r*'/g,'').replace(/(^'|';$)/g,''));
                var canvas=canvasArea.graphics;
                var counter=obj.total;
                while(counter>=0){
                    for(all in obj){
                        if(all.match(/\d{1,2}$/g) && all.match(/\d{1,2}$/g)==counter){
                            var thisShp=obj[all];
                            if(all.match('group')){
                                var ctr=obj[all].total;
                                while(ctr>=0){
                                    for(paths in obj[all]){
                                        if(paths.match(/\d{1,2}$/g) && paths.match(/\d{1,2}$/g)==ctr){
                                            drawPath(obj[all][paths]);
                                    ctr--;
                            } else {
                                drawPath(thisShp);
                    counter-=1;
            var doc=app.activeDocument;
            if(doc.height<=400 && doc.width<=600){
                doc.rulerOrigin=[0,doc.height];
                doc.coordinateSystem=CoordinateSystem.DOCUMENTCOORDINATESYSTEM;
                var wDims=function(){
                    var dims={width: '', height: ''};
                    if(doc.width>220){
                        dims.width = Math.round(doc.width);
                    } else {
                        dims.width = 220;
                    if(doc.height>20){
                        dims.height = Math.round(doc.height);
                    } else {
                        dims.height = 20;
                    return dims;
                function drawCapture(docArt, dataDisplay, graphicDisplay){
                    function capturePathItem(pathItem, drawObj, count){
                        var thisShp=pathItem, drawData=drawObj, i=count;
                        if((thisShp.filled || thisShp.stroked) && thisShp.editable==true){
                            drawData['shape_'+i]={};
                            drawData['shape_'+i].fillColor=null;
                            drawData['shape_'+i].name=thisShp.name;
                            drawData['shape_'+i].tag=thisShp.note;
                            drawData['shape_'+i].strokeColor=null;
                            drawData['shape_'+i].pathPoints=[];
                            drawData['shape_'+i].ellipsePath=false;
                            if(itemShape(thisShp).iscircle==true || itemShape(thisShp).isellipse==true || thisShp.name=='ellipse' ||
                                thisShp.name=='circle' || thisShp.name=='cir'){
                                drawData['shape_'+i].ellipsePath=true;
                                drawData['shape_'+i].pathPoints=[Math.round(thisShp.left), Math.round(-thisShp.top), Math.round(thisShp.width), Math.round(thisShp.height)];
                                canvas.newPath();
                                canvas.ellipsePath(Math.round(thisShp.left), Math.round(-thisShp.top), Math.round(thisShp.width), Math.round(thisShp.height));
                            } else {
                                var vectorPts=thisShp.pathPoints;
                                canvas.newPath(); canvas.moveTo(Math.round(vectorPts[0].anchor[0]),-Math.round(vectorPts[0].anchor[1]));
                                for(var j=0; j<vectorPts.length; j++){
                                    var thisAnchor=vectorPts[j].anchor;
                                    var x=Math.round(thisAnchor[0]), y=-Math.round(thisAnchor[1]);
                                    drawData['shape_'+i].pathPoints.push([x,y]);
                                    canvas.lineTo(x,y);
                            if(thisShp.closed || drawData['shape_'+i].ellipsePath==true){
                                drawData['shape_'+i].closed=true;
                                if(drawData['shape_'+i].ellipsePath!=true){
                                    canvas.closePath();
                            } else {
                                drawData['shape_'+i].closed=false;
                            if(thisShp.filled){
                                var clr=thisShp.fillColor;
                                var colorArray=convertToUIRGB(clr);
                                var myBrush=canvas.newBrush(canvas.BrushType.SOLID_COLOR,colorArray);
                                drawData['shape_'+i].fillColor=colorArray;
                                canvas.fillPath(myBrush);
                            if(thisShp.stroked){
                                var clr=thisShp.strokeColor;
                                var colorArray=convertToUIRGB(clr);
                                var myPen=canvas.newPen(canvas.PenType.SOLID_COLOR,[colorArray[0],colorArray[1],colorArray[2] ,1], Math.round(thisShp.strokeWidth));
                                drawData['shape_'+i].strokeColor=colorArray;
                                drawData['shape_'+i].strokeWidth=Math.round(thisShp.strokeWidth);
                                canvas.strokePath(myPen);
                    // docArt is lately the layers[0].pageItems
                    // draws a preview and creates a drawing data object resource.
                    var drawData={total:0}; //Put drawing shapes here.  Properties: stroke (rgb color | null), fill (rgb color | null), pathPoints
                    var canvas=graphicDisplay.graphics;
                    vectors=function(){
                        var arr=[];
                        for(var i=0; i<docArt.length; i++){
                            var thisShp=docArt[i];
                            if(thisShp.typename=='PathItem' && thisShp.parent.typename!="GroupItem"){
                                if((thisShp.filled || thisShp.stroked) && thisShp.editable==true){
                                    arr.push(thisShp);
                            } else if(thisShp.typename=='GroupItem'){
                                if(thisShp.pathItems.length>0){
                                    var smArr=[];
                                    for(var j=0; j<thisShp.pathItems.length; j++){
                                        var thisPth=thisShp.pathItems[j];
                                        if((thisPth.filled || thisPth.stroked) && thisPth.editable==true){
                                            smArr.push(thisPth);
                                    if(smArr.length>0){arr.push(smArr);};
                        return arr;
                    drawData.total=vectors.length;
                    for(var i=vectors.length-1; i>-1; i--){
                        var thisShp=vectors[i];
                        if(thisShp instanceof Array){
                            var grpObj={};
                            for(var j=thisShp.length-1; j>-1; j--){
                                var thisPth=thisShp[j];
                                capturePathItem(thisPth, grpObj, j);
                            grpObj.total=thisShp.length;
                            var grpNm=function(){
                                if(thisShp[0].parent.name!=''){
                                    return thisShp[0].parent.name+"_";
                                return '';
                            drawData['group_'+grpNm+i]=grpObj;
                        } else {
                            capturePathItem(thisShp, drawData, i);
                    return drawData;
                function showDrawerFunc(objStringDisplay, wDims){
                    var w2=new Window('dialog','Drawer Function');
                    var containerG=w2.add('tabbedpanel');
                        var funcG=containerG.add('tab',undefined,'Drawer Function');
                            var dispE=funcG.add('edittext',undefined,funcSrc,{multiline:true}); dispE.size=[580,200];
                            var selBtn=funcG.add('button',undefined,'Select All');
                        var drawingG=containerG.add('tab',undefined,'Drawing:');
                            var drawG=drawingG.add('group');
                                var drawP=drawG.add('panel',undefined,''); drawP.size=[wDims.width, wDims.height];
                    var msgCntr=w2.add('panel',undefined,'Message Center:');
                        var msgE=msgCntr.add('edittext',undefined,'',{multiline:true});msgE.size=[560,40];
                    var btnG=w2.add('group');
                        var okBtn=btnG.add('button',undefined,'Ok',{name: 'ok'});
                    selBtn.onClick=function(){
                        dispE.active=false; dispE.active=true;
                    drawG.onDraw=function(){
                        if(objStringDisplay.text!=''){
                            try{
                                drawFromObjString(objStringDisplay.text, this);
                            } catch(e){
                                msgE.text=("Something isn't right:\r"+e);
                        } else {
                            msgE.text=('You must first put a valid object string into the object string display area--> "Get Source Object String" button, 1st window, 1st tab.');
                    w2.show();
                function instructions(){
                    var w3=new Window('dialog','instructions');
                    var instructions=w3.add('edittext',undefined,'',{multiline:true}); instructions.size=[400,100];
                    instructions.text="1)  Have a document open, smaller than 600x400.\r\r"+
                        "2)  Draw some stuff- use paths only, straight lines or ellipses only. To have script explicitly recognize ellipse, "+
                        "label the path 'cir', 'circle', or 'ellipse'. Right now there's a function to detect (non-rotated) ellipses, but it is coarse.\r\r"+
                        "3)  Run this script and see if your drawing was captured in the main window.\r\r"+
                        "4)  Click the 'Get Object String' button and see the drawing instruction string appear.\r\r"+
                        "5)  Click the 'View Drawer Function/Drawing' button to see the function used to draw scriptUI picture from"+
                        " the object string and use other tab to see the drawing made with this function from that object string.\r\r"+
                        "6)  Edit your string to see your picture change if needed!";
                    var okBtn=w3.add('button',undefined,'OK');
                    w3.show();
                var funcSrc=drawFromObjString.toSource();
                var dispWindow=function(){
                    var drawData;
                    var w=new Window('dialog','ScriptUI Graphics Display');
                    var panel=w.add('panel',undefined,''); panel.size=[wDims.width+6,wDims.height+6];
                    var list=w.add('edittext',undefined,'',{multiline:true}); list.size=[wDims.width,150];
                    var formatG=w.add('group');
                        var formatH=formatG.add('statictext',undefined, 'Format:');
                        var format_returns=formatG.add('button',undefined, 'Returns before "(group|shape)_"');
                    var btnsG=w.add('group');
                        var clickBtn=btnsG.add('button',undefined,'Get Source Object String');
                        var selectBtn=btnsG.add('button',undefined,'Select All');
                    var btnG2=w.add('group');
                        var funcBtn=btnG2.add('button',undefined,'See Drawer Function/Drawing');
                        funcBtn.helpTip='Uses the Object String picture info to draw using ScriptUIGraphics lineTo commands.';
                        var helpBtn=btnG2.add('button',undefined,'?'); helpBtn.size=[25,25];
                    panel.onDraw=function(){
                        drawData=drawCapture(doc.layers[0].pageItems, list, this);
                    clickBtn.addEventListener('mousedown',function(){
                        list.text=drawData.toSource();
                    format_returns.onClick=function(){
                        var str=list.text;
                        var rx=/(group|shape)_/g;
                        if(str!=''){
                            var rx=/(group_|shape_)/g;
                            var matches=str.match(rx);
                            for(var i=0; i<matches.length; i++){
                                var instance = rx.exec(str);
                                str=str.substring(0, rx.lastIndex-instance[0].length)+str.substr(rx.lastIndex-instance[0].length,).replace(ins tance[0],"'+\r'"+instance[0]);
                        list.text="'"+str+"';";
                    funcBtn.onClick=function(){
                        showDrawerFunc(list, wDims);
                    helpBtn.onClick=function(){
                        instructions();
                    selectBtn.onClick=function(){
                        list.active=false; list.active=true;
                    var okBtn=w.add('button',undefined,'OK');
                    w.show();
            } else {
                alert('Please use a document with main artboard no larger than 600x400.');
        } else {
            alert('Must run in Illustrator with at least 1 document open.');
    graphicsDisplay();

  • How to update a ScriptUIGraphics object?

    Hello,
    I've been able to use ScriptUIGraphics, but as far as I've seen there's no way to update / change any object, nor it seems possible to call the onDraw() handler but once if it contains either fillPath() or strokePath() - which usually does.
    For instance, the following test script pops up a panel with a red square in it. Fine. When you click the "Try" button, the onDraw() is fired again and should draw a smaller square, but stops with a very informative "cannot execute" error at some point within the onDraw():
    // ScriptUI graphics update issue
    // resource string
    var winRes = "dialog {  \
        text: 'ScriptUI Graphics test',  \
        margins: 15, \
        alignChildren: 'row', \
        canvas: Panel {  \
            preferredSize: [200, 200], \
            properties: {borderStyle: 'black'} , \
        buttonsGroup: Group{ \
            cancelButton: Button { text: 'Cancel', properties:{name:'cancel'} }, \
            tryButton: Button { text: 'Try', properties:{name:'try'},size: [40,24], alignment:['right', 'center'] }, \
    // Window
    var win = new Window(winRes);
    // define the graphic property
    canvasGraphics = win.canvas.graphics
    // do the drawing
    win.canvas.onDraw = function() {
              // creates a red filled square
              canvasGraphics.newPath()
              canvasGraphics.rectPath(10, 10, 200, 200)
              canvasGraphics.fillPath(canvasGraphics.newBrush(canvasGraphics.BrushType.SOLID_COLOR, [1,0,0,1], 1)) // HERE
    win.buttonsGroup.tryButton.onClick = function() {
              win.canvas.onDraw.call()
    win.show()
    When you run it, it works as expected; if you click the Try button, an error is fired when the script gets to the line ("HERE" in the code), that is: when it comes to fill the path.
    Strangely enough! Because it doesn't seem to be a problem with the onDraw second call (apparently the second square path is constructed, but can't be filled).
    Am I doing something wrong here? Should I first delete the original square (how?!), or somehow initialize it again? Are ScriptUIGraphics immutable somehow?
    --- Update ---
    Further experiments led me to understand that onDraw() (so the whole drawing) seem to be called just once - when the Window is shown. I've tried to remove and rebuild the canvas Panel altogether, but its own new onDraw() is never called - nor an explicit call works. Apparently you can't invoke win.show() again, nor hide and show it. Ouch!
    Thanks in advance for any suggestion
    Davide

    Sorry, I do not understand what do you really want (because of my bad english)
    Try to change the bg color of the panel in the dialog box by clicking on button? Something like this?
    // ScriptUI graphics update issue
    // resource string
    var winRes = "dialog {  \
        text: 'ScriptUI Graphics test',  \
        margins: 15, \
        alignChildren: 'row', \
        canvas: Panel {  \
            preferredSize: [200, 200], \
            properties: {borderStyle: 'black'} , \
        buttonsGroup: Group{ \
            cancelButton: Button { text: 'Cancel', properties:{name:'cancel'} }, \
            tryButton: Button { text: 'Try', properties:{name:'try'},size: [40,24], alignment:['right', 'center'] }, \
    // Window
    var win = new Window(winRes);
    // define the graphic property
    win.canvas.graphics.backgroundColor = win.canvas.graphics.newBrush (win.canvas.graphics.BrushType.SOLID_COLOR, [1,0,0],1);
    win.buttonsGroup.tryButton.onClick = function() { // change the graphic background property by click on Button [try]
    win.canvas.graphics.backgroundColor = win.canvas.graphics.newBrush (win.canvas.graphics.BrushType.SOLID_COLOR, [0,0,1],1);
    win.show()

  • Multi-page ID file into multiple individual ID files

    I am creating a catalog in ID and have started it as a single file with multiple pages. My printer has asked that I submit it as multiple individual ID pages. I found a script that will do it for me. The problem is that I have applied master pages to the files and when the files get exported into individual pages they all take the characteristics of the 1st page. i.e. the number is "1" on all of them and appears on the right side. The question is, is there a script that has been made that deals with this already, or is there a way to "flatten" the ID file before I run the script so that the numbering doesn't shift around?

    @RGBguyinaCMYKwrld – +1 to that what Larry and Colin already said.
    But, in general, there might be really good reasons separating a document into individual parts.
    Might be a colaboration workflow with several designers where the project began with one person…
    Or in a DPS workflow.
    The Swiss scripter Hans Häsler did a lot of scripts and one of them is slicing an InDesign file into pieces. Page by page, range by range or other criteria. The script comes in German language, but the source code is available, so you could translate it. It has a ScriptUI graphical user interface. A extensive readme file comes with the code (LiesMich_Aufsplitten.txt).
    Hans Haesler
    (Split Documents Script v515d)
    DokumenteAufsplitten.zip
        DokumentAufsplitten_515d.js
        LiesMich_Aufsplitten.txt
    German Interface:
    http://www.fachhefte.ch/downloads.php?groupIDX=&orderby=name&sort=ASC&search_query=&itemID X=&begin=&limit=&read_group=18&page=0&downloadIDX=655
    If the link will not work (maybe due to an update of the site), look under Downloads / JavaScripts at: www.fachhefte.ch
    Uwe

  • How do i stop draw refresh on mouseover?

    I am drawing shapes on a custom element, and running a function on draw. for somereason it is constantly redrawing anytime I mouse over the shape how can I stop that?I am using cs6. here is a sample code with the issue that I am talking about was taken from a photoshop scripting forum but illustrtates my point. everytime you mouseover or mouseout the square it initiates the on draw but i only want it to redraw on the press of a button.
    var winRes = "dialog {  \
        text: 'ScriptUI Graphics test',  \
        margins: 15, \
        alignChildren: 'row', \
        canvas: Custom {  \
            preferredSize: [200, 200], \
            creation_properties: {borderStyle: 'black'} , \
        buttonsGroup: Group{ \
            cancelButton: Button { text: 'Cancel', properties:{name:'cancel'} }, \
            tryButton: Button { text: 'Try', properties:{name:'try'},size: [40,24], alignment:['right', 'center'] }, \
    // Window
    var win = new Window(winRes);
    function color() { return [Math.random(),Math.random(),Math.random(),1] }
    // define the graphic property
    canvasGraphics = win.canvas.graphics
    // do the drawing
    win.canvas.onDraw = redraw
    function redraw() {
              // creates a red filled square
              canvasGraphics.newPath()
              canvasGraphics.rectPath(10, 10, 200, 200)
              canvasGraphics.fillPath(canvasGraphics.newBrush(canvasGraphics.BrushType.SOLID_COLOR, color(), 1)) // HERE
    win.buttonsGroup.tryButton.onClick = function() {
          win.canvas.notify("onDraw")
    win.show()

    This appears to be a bug that has been fixed in AECC. I tried it in CS6 and the color box flickers like mad when you mouseover it and also changes when clicking the button. In AECC it appears to be working properly and is not effected by mousing over the box.

  • [JS CS4/CS5] ScriptUI Click Event Issue in JSXBIN

    Still working on a huge ScriptUI project, I discovered a weird issue which appears to *only* affect 'binary compiled' scripts (JSXBIN export), not the original script!
    When you repeatedly use addEventListener() with the same event type, you theorically have the possibility to attach several handlers to the same component and event, which can be really useful in a complex framework:
    // Declare a 'click' manager on myWidget (at this point of the code)
    myWidget.addEventListener('click', eventHandler1);
    // Add another 'click' manager (for the same widget)
    myWidget.addEventListener('click', eventHandler2);
    When you do this, both eventHandler1 and eventHandler2 are registered, and when the user clicks on myWidget, each handler is called back.
    The following script shows that this perfectly works in ID CS4 and CS5:
    // Create a dialog UI
    var     u,
         w = new Window('dialog'),
         p = w.add('panel'),
         g = p.add('group'),
         e1 = p.add('statictext'),
         e2 = p.add('statictext');
    // Set some widget properties
    e1.characters = e2.characters = 30;
    g.minimumSize = [50,50];
    var gx = g.graphics;
    gx.backgroundColor = gx.newBrush(gx.BrushType.SOLID_COLOR, [.3, .6, .9, 1]);
    // g->click Listener #1
    g.addEventListener('click', function(ev)
         e1.text = 'click handler 1';
    // g->click Listener #2
    g.addEventListener('click', function(ev)
         e2.text = 'click handler 2';
    w.show();
    The result is that when you click on the group box, e1.text AND e2.text are updated.
    But now, if I export the above code as a JSXBIN from the ESTK, the 2nd event handler sounds to be ignored! When I test the 'compiled' script and click on the group box, only e1.text is updated. (Tested in ID CS4 and CS5, Win32.)
    By studying the JSXBIN code as precisely as possible, I didn't find anything wrong in the encryption. Each addEventListener() statement is properly encoded, with its own function handler, nothing is ignored. Hence I don't believe that the JSXBIN code is defective by itself, so I suppose that the ExtendScript/ScriptUI engine behaves differently when interpreting a JSXBIN... Does anyone have an explanation?
    @+
    Marc

    John Hawkinson wrote:
    Not an explanation, but of course we know that in JSXBIN you can't use the .toSource() method on functions.
    So the implication here is that perhaps the .toSource() is somehow implicated in event handlers and there's some kind of static workaround for it?
    Perhaps you can get around this by eval() or doScript()-ing strings?
    Thanks a lot, John, I'm convinced you're on the good track. Dirk Becker suggested me that this is an "engine scope" issue and Martinho da Gloria emailed me another solution —which also works— and joins Dirk's assumption.
    Following is the result of the various tests I did from your various suggestions:
    // #1 - THE INITIAL PROBLEM// =====================================
    // EVALUATED BINARY CODE
    var handler1 = function(ev)
         ev.target.parent.children[1].text = 'handler 1';
    var handler2 = function(ev)
         ev.target.parent.children[2].text = 'handler 2';
    var     u,
         w = new Window('dialog'),
         p = w.add('panel'),
         g = p.add('group'),
         e1 = p.add('statictext'),
         e2 = p.add('statictext');
    e1.characters = e2.characters = 30;
    g.minimumSize = [50,50];
    var gx = g.graphics;
    gx.backgroundColor = gx.newBrush(gx.BrushType.SOLID_COLOR, [.3, .6, .9, 1]);
    g.addEventListener('click', handler1);
    g.addEventListener('click', handler2);
    w.show();
    eval("@JSXBIN@[email protected]@MyBbyBn0AKJAnASzIjIjBjOjEjMjFjShRByBNyBnA . . . . .");
    // RESULT
    // handler 1 only, that's the issue!
    Now to John's approach:
    // #2 - JOHN'S TRICK
    // =====================================
    var handler1 = function(ev)
         ev.target.parent.children[1].text = 'handler 1';
    var handler2 = function(ev)
         ev.target.parent.children[2].text = 'handler 2';
    // EVALUATED BINARY CODE
    var     u,
         w = new Window('dialog'),
         p = w.add('panel'),
         g = p.add('group'),
         e1 = p.add('statictext'),
         e2 = p.add('statictext');
    e1.characters = e2.characters = 30;
    g.minimumSize = [50,50];
    var gx = g.graphics;
    gx.backgroundColor = gx.newBrush(gx.BrushType.SOLID_COLOR, [.3, .6, .9, 1]);
    g.addEventListener('click', handler1);
    g.addEventListener('click', handler2);
    w.show();
    eval("@JSXBIN@[email protected]@MyBbyBn0AIbCn0AFJDnA . . . . .");
    // RESULT
    // handler1 + handler2 OK!
    This test shows that if handler1 and handler2's bodies are removed from the binary, the script works. Note that the handlers are declared vars that refer to (anonymous) function expressions. (BTW, no need to use a non-main #targetengine.) This is not a definitive workaround, of course, because I also want to hide handlers code...
    Meanwhile, Martinho suggested me an interesting approach in using 'regular' function declarations:
    // #3 - MARTINHO'S TRICK
    // =====================================
    // EVALUATED BINARY CODE
    function handler1(ev)
         ev.target.parent.children[1].text = 'handler 1';
    function handler2(ev)
         ev.target.parent.children[2].text = 'handler 2';
    var     u,
         w = new Window('dialog'),
         p = w.add('panel'),
         g = p.add('group'),
         e1 = p.add('statictext'),
         e2 = p.add('statictext');
    e1.characters = e2.characters = 30;
    g.minimumSize = [50,50];
    var gx = g.graphics;
    gx.backgroundColor = gx.newBrush(gx.BrushType.SOLID_COLOR, [.3, .6, .9, 1]);
    g.addEventListener('click', handler1);
    g.addEventListener('click', handler2);
    w.show();
    eval("@JSXBIN@[email protected]@MyBbyBnACMAbyBn0ABJCnA . . . . .");
    // RESULT
    // handler1 + handler2 OK!
    In the above test the entire code is binary-encoded, and the script works. What's the difference? It relies on function declarations rather than function expressions. As we know, function declarations and function expressions are not treated the same way by the interpreter. I suppose that function declarations are stored at a very persistent level... But I don't really understand what happens under the hood.
    (Note that I also tried to use function expressions in global variables, but this gave the original result...)
    Thanks to John, Dirk, and Martinho for the tracks you've cleared. As my library components cannot use neither the global scope nor direct function declarations my problem is not solved, but you have revealed the root of my troubles.
    @+
    Marc

  • [JS CS3/4] ScriptUI How to color a button ?

    Is it a way to get a colored button in the ScriptUI DOM ?
    I tried
    dlg.button1.graphics.backgroundColor = dlg.button1.graphics.newBrush(dlg.button1.graphics.BrushType.SOLID_COLOR,[0.7,0.7,0.7],1);
    But although the dialog is drawn, the button is not styled in best case, not visible in the worst case.
    Is that possible to get a colored button ?
    Hope so.
    Do you have any tip ?
    TIA
    Loic

    I have tried in the past but not been able to color a button.
    What I have been able to do is use the onDraw callback to print an image instead of the standard control.
    You may want to try that.
    Wish I could be of more help. Kasyan's correct, the docs are sketchy at best. The biggest hurdle is that some of the custom drawing functionality seems to be a bit brittle and prone to failure in some cases.
    Below is an example of drawing an image in place of a dropdown list to make a poor mans' flyout menu.
    Regards
    Bob
    // Ever wanted to embed an image file in a jsx file?
    // below is a multi-step process for doing so. It's a little cumbersome but worth the bother at times when a script depends on
    // a binary object, but there is no fail-safe way to ensure the binary is delivered or installed with the script (like this sample!)
         function myFileStringer( myFile ) {
              // read the image file
              myFile.encoding = "BINARY";
              myFile.open( "r" );
              var myBuf = myFile.read();
              myFile.close();
              // create an output file of the same name with the extension "txt"
              var outName = myFile.name.substr( 0, myFile.name.lastIndexOf( "." ) ) + ".txt";
              var outFile = new File( myFile.parent.absouteURI + "/" + outName );
              outFile.open( "w" );
              // write the buffer to the text file using toSource(). The text in the file will be JSON, ready to copy and paste into your script
              outFile.write( myBuf.toSource() );
              outFile.close();
              // open the text file, copy the text in the file in a single line, paste it into your source code as a single line, something like this:
              // var myBinary = (newString("\u0089PNG\r\n\x\1\A\n\x00\x00\x00\riHDR\x00\x00\x00... ) );
              // it will be a very long string
         function myFileMaker() {
              // the (new String(....) in the line below is the output as pasted from myFileEnstringer
              // it is in JSON notation from the toSource() call above - when this line is executed, myBinary will contain an accurate binary representation of the image
              // the binary below is a PNG image that is an icon for a flyout menu.
              var myBinary = (new String("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\t\b\x06\x00\x00\x00;*\u00AC2\x00\x00\x00\tpHYs\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\u009A\u009C\x18\x00\x00\x0FciCCPPhotoshop ICC profile\x00\x00x\u00DA\u00ADWi8\x14\u00EC\u00D7?3\u00C6\u00D8\u00C76\u00C6\u00CEX\u00B2d\x1B\u00FB\u0096u\u0090\u009D\u00EC$\u008C\x19\u00CBX\u00A7\u00B1/\u00A1B\u008F\u0088\u00B4\u00A1\u0088\x14i\u00A1\u0094\u0084\u0092\u00AD\u00B2\u0094\u00A2\x12ey\u00B2\u00A6B\"K\u008B\u00E6\u00FD\u00A0\u00A7\u00E7\u00BA\u00FE\u00EF\u00F5\u00BE\u00EF\u0097\u00F7|\u00FA\u009Ds\u009Ds~\u00E7\u00BE\u00CF}]\u00E7>\x00\u00BCB$\x1A-\x02\t\x00\u0091Q\u00B1t\u0097\u00DD\u00E6x/o\x1F<\u00CBk\u00E0\x04~\u00C0\u0082>H\u0092\u00C8143gg{\u00F8\x1Fe\u00FD5 \x00\x00^\u00AA\u0090h\u00B4\u0088|\u00F6\x00J\u00DF\u00D4\u00D9\u0092z\u00C3\x15\u00E7/\u00B2\u0087d\u00E1\x7F\x17\f\u00DD\u00CB\u00DB\x07\x00\u00A1\f\x00\u00D8\u0090ml\n\x00\u00D8\u00C0m\u00EC\x06\x00\u00D8\u0084XZ,\x00\"\x14\x00\u00B0\u00E4P\x12\x05\x00\u0091\n\x00\u00CAt7\x17\"\x00\u00A2\x06\x000!\u00DB\u00B8\t\x000\u0081\u00DB\u00B8\x07\x000\u00F1\u00E4\u0090X\x00\u00C4\b\x00\u009A/\u008AB\u008D\x02`Y\x00@\x1BS\u0082b\u00C8\x00\x18e\x00\u00A0Pb\u00C8\u0091\x00\u0098\u00E3\x00H\u00D5\u00C8\u00C8h\n\x00O;\x00(\u0090i\u00F4X\x00\u009Ey\x00P\u00F1\u00F2\u00F6\u00C1o\u0097L\u00D9\x000@\x01\u00A0\u00DF\u00FEk\x0B\u0093\x02\u00A8\u00BD\x03 &\u00F5\u00AFM\u00FE\x01\u0080\x10\t\u00E0\u00E6\u00CE\x7Fm\u00AB.\u0080\x00\x00\x04\u00EEyL\u00B0\u00A6\x06\x00\x00 8\u00CD\x01\u0098'\x18\u008CU9\x00\u0096\x13\x00[\u0085\f\u00C6\u008FJ\x06c\u00EB\"\x00\u00D3\x18@{\x049\u008E\x1E\u00FF\u00FB\u00BE\x10\u0088~\u0080\u00FFK\u00DF>\u00F3oaB\x00 \x01\u0090jL\u008E\u00A8P\u00E6\x03\u00E8\x12\u0096\u009B\u00AC\u009Dl#\u00EC\u009F8V\u00B8\u00D81\u0082\u00DCR<*\u00BC\x06|f\u00FC\u00F6X7\x01O\u009C\u009F Y\u0088*L\x13\u0089\x11\u008D\x15\u008B\x13O\u0094H\u0091\u00CC\u00C0gJeJ\x1F\u00919*\u009B\u00BF\u00E3\u00B4\u00DC9\u00F9\n\u0085\x1A\u00C5\x1B;\u009B\u0094\u00BA\u0095\u0087T&U\u00D7\t\u00EC\u00EA\u00D2\x1A\u009A\u009A\u00EEZ)\u00DA\x15:}\u00BA\u009B\u00FA\u008A\x06$\u00C3s\u00BB\u00C6\u008D%M\u00A8\u00A6w\u00CD9\u0089\u00FB,n[\u00F1\u00ED\u00A6[\x0F\u00DA\u00AA\u00D9\x1D\u00B3\u00FF\u00E2h\u00EFT\u00B7\u0087\u00DB%\u00C2\u00B5\u00CF]\u00D4#\u00C2\u00F3\u00817\u00C6\u00C7\x7Fo\u008D\u00EFW?\u00A2\u00FF\u00D1\u0080\u00FE@n\u00B2\x13\u00E5D\u00D0\u00F3\x10\u00F6P3j\\X]\u00F8d$\x7F\u0094Et\x02\u00ED\u00FA\u00FE\u00B71\u00A8XB\u009C\x7F|^\u00C2\u00FD\u00C4\u00F9d\u00DE\x14\u00E3T\u00DA\u0081\u00F2\u00B4\u00EE\u00F4\u00B1\u008C\u00A9\u0083\u00B3\u0087\x16\x0E/g\u00AEd\u00ADgo\u00FD\u0085\u00CA\u00E1<\u00CA\u009B+\u0090'~L!_\u00B3\u00C0\u00F0\u00B8Y\u00A1\u00F5\u0089='=N\u00F9\u009C\u00F6;C.\u00A2\x16\u0087\u0097\u0084\u009F\u00A5\u009E\u00A3\u0096\u0086\u0095\u0085\u009E'\u0095\u00FBT\u00B8^\u00B0\u00AB4\u00BD\u00A8~I\u00B1J\u00BEz\u00C7e\u00E9\x1A\u00FC\x15\u00F1\u00AB\u00C2\u00D7\x04\u00AE\u00F3\u00D6\u00F2\u00D4q\u00DE`\u00BE\u00F1\u00EB\u00E6f\u00FD\u00EA\u00AD\u00C5\u00DB\u00B3\r\u00A3w\x06\x1B\u009F\u00DE\u00EDjjn\u00AEo\u00B9~\u00EF\u00CA\u00FD\x0B\u00ADg\x1E\u00E4\u00B7\x1Dm\u00CF\u00EC8\u00D8\u0099\u00DCE\x7F\x18\u00F5(\u00EAqD7\u00A9\u0087\u00D8\u008B\u00EB\u009D\u00EA\u00BB\u00F5$\u00FD\u00A9m\u00BF`\u00FF\u00DC\u00B3\u0086\u00E7\u0099\x03.\u0083\u0092\u0083\u008B/\u00DA_\x16\u00BE\u00F2\x1FR\x19\u00FA\u00FE\u00FA\u00C9p\u00D1\b\u00E9\u008D\u00CA\u009Boo\x1F\u008F\x16\u008Cy\u008C\u008B\u008F\u00CFL\u00D4\u00FEM\x7F\u00A7\u00F3\u00EE\u00DBd\u00CBT\u00CA\u00B4\u00C1\u00F4\u00FAL\u00E3l\u00EA\u009C\u00D9{\u00A6\u00F7\u00BD\u00F3y\x1F\x1C?\u00F2||\u00F9\u00A9h\u00C1kQhqd\u00A9\u00F8\u00B3\u00D7\u00B2\u00D0\u00F2\u00D0\u0097\u00C2\x15\u00C7U\u00AE\u00D5\u00DE\u00AF\u0099kfk\u008C\u00F5\x07\x1B\u00C9\u009B\u00DA\u009B\u00CB\u00DFj\u00BF\u0087\u00FFP\u00FC1\u00F7\u00B3r+\u00E0\u0097\u00E4\u00AF\u00B7\u008C\u00FD\f\x06\x00\x12\u00C5\u00C4\u0087\u00C21c\u00D1\x02,\u00DC\u00AC\x1Cl\u00ACl[\u00EC\u00DF8>s\u00CEp\u00BD\u00C1\u00F4sw\u00F0\u00D4\u00F3V\u00F2\u009D\u00E2\u00CF\u00C2&\b\u0084\u00E3\u00F6\t:\t\x11\u0085\u00F5EtD\u0095\u00C5\u00D4\u00C4U%t$\u008D\u00F1\u0096R&\u00D2z2*\u00B2\u00CA;\u0094\u00E5v\u00CA\x13\x14\u0094\x15\t;u\u0094\u0088\u00CA\u00B6*^\u00AAT\u00B5$B\u008Ez\u0099F\u00A3\u00E6s\u00AD%\x1D^]-=W\u00FDd\u0083\u00CB\u0086\u00C3F\u00AC\u00C6\u00DA&\u00FBMk\u00CD\u00E6\u0089J\x16\u00E1\u00967\u00AC6\u00AD-mrmG\u00EC\u00D5\x1DR\x1D\x07\u009DE\u00F7\u0084\u00B84\u00BA!\u00DC\x1D<Nx\u008Ey+\u00FA\u00D0\u00F6\u00DE\u00F2\u00DD\u00F0\u00D3\u00F3?\x10\u00D0F\u00DA\"\x1BR\u00E2\u0083\u00EE\x06\u00AF\u0086\u00AAR\u00C3\u00C2\u00AE\u0086\x7F\u008C\u0094\u008B\u00F2\u008D.\u00A6\u00BD\u00A6\u00F3\u00C7\u00B8\u00C5\x16\u00C6\u00F5%\u00B0&\u00DA'\u00E5'?J\u0099N\u00FDt\u00E0s\u00DAZ\u00FA\u00B7\u008C\u00EF\x07\x7F\x1Df\u00CE\u00E4\u00CC\u00E2\u00CF\x16>\"\u00FE\u0097l\x0E\u00E1\u00A8A\u00AEy\u009E\u00CD1\u00A7|\u00AF\x02\u00DF\u00E3\x01\u0085\u0094\x13a'\u00A3O\u00D1N\u00D3\u00CFD\x17E\x15\u00D3J\"\u00CF\x06\u009F\x0B(\u00F5*s>oY\u00AES\u00A1rA\u00A5R\u00F9\u00A2\u00E2%\u00C5*\u0085j\u00B9\u00CB\u00B252Wd\u00AF\u00CA\\\u0093\u00BC.V+R'|C\u00E8\u00A6@=\u00DF-\u00EE\u00DB\u00DC\r\u0098;\\\u008D\\wy\u009Bp\u00CDB-B\u00F7D\u00EF\u00E3[\u00E5\x1F\u00A8\u00B6i\u00B7\u00EBw\u0098w:v\u00F9<\u00DC\u00FBh\u00F7c\u00FC\u00E3\u0095\u00EE\u00DE\u009E\u00D2\u00DE\u00C8>\u00B3'\u0082O\x16\u009F>\u00EA/y\x16\u00F9\u009C8 >\u00B0>\u00D8\u00FF\u00A2\u00F2e\u00C2+\u00C7!\u00E9\u00A1\u00B5\u00D7\u00BD\u00C3\u00A5#\u00D1o\u00CC\u00DE\u00F2\u00BE\x1D\x1F\u00BD>\u0096:n=\u00C1;1\u00FAw\u00E5\u00BB\u00B0I\u00D5\u00C9\u00E5\u00A9\u00A6\u00E9\u00E33\u00A1\u00B3&s\u0082s\u008B\u00EF\x1F\u00CE\u0097|\u0088\u00FAh\u00F9I\u00F8\u00D3\u00C7\u0085\u00FB\u008B\u00C7\u0096\u00F6}V\u00FD\u00FCc\u00B9\u00FB\u00CB\u0089\x15\u00BFU\u00C5\u00D5\u0095\u00AF\u00F7\u00D6\u00B2\u00D7\u009D7\u00846\u00C66+\u00BFQ\u00BF\x13\u00BEo\u00FE\u00B8\u00FF3c\u00CB\u00F2\x17\u00E6\u00D7sF\u00E4v\u00FF\u0091\x1BL\u00CB\u00A8\u00AF\u00CC\u009F\u00D1\u008B,\u008B\u00AC\u008Bl\x13\u00EC\u00A3\x1C\u00AF8\u009Fp\u00B5b\u00EA\u00B8\u00CByry\x13\u00F8(\u00FC\u00F6X\u0082\x00\u00B7\u00C0*nP\u00F0\u009AP\u00A6\u00B0\u00AF\bA\u0094YtX\u00ACJ<N\u00C2R\u0092[r\x1C_%\x15)m \u0083\u0096y-{eG\u009A\u009C\u00BB\u00BC\u00B2\x02\u00AB\u00C2{\u00C5\u00EE\u009D5J\u00C7\u0094cU\u00F6\u00AA\u009A\u00AB\u00A9\x12\u00C4\u00D4\u00D9\u00D474f5\x07\u00B5\u00DA\u00B5o\u00EA\u0094\u00E9\u00E6\u00E8\u00C5\u00EB\u0093\f\u00EC\rw\u00ED\u00C2\x1B\u00A1\u008D\u0096\u008D\u0087L\u00EE\u0098\u009E4\u008B7\u00A7\x12=-\u00AC,\u00F5\u00AC\u00E4v\x0BY3[\u00AF\u00DB|\u00B0}c\u00D7c\u00DF\u00E8P\u00EDX\u00EC\u0094\u00E3\u009C\u00B8'\u00C4\u00C5\u00C3\u00D5\u00DE\u00CD\u00D0]\u00D9C\u00D2\x13\u00E7\u00C5\u00E5\u008D\u00F4\u00FE\u00EA\u00F3a\u00EF\u0094\u00EF\u00DB}\u00AF\u00FC\u00FA\u00FD\u00BB\x02\x1E\u0090Z\x03[\u00C8\u00B7(\x17\u0083r\u0082\u00E9!\u00FE\u00A1\u00D6T\u00B50\u0091p\u0096\u00F0\u00B5\u0088\u0099\u00C8\u00C1\u00A8\x07\u00D1u\u00B4\u00CA\u00FDg\u00E8\x7F\u00C5$\u00C6\u0086\u00C6\u00F9\u00C5;&\x18'\u00AA%I%cSP)\u00AB\u00A9\u00EF\x0E<K{\u0090~-\u00E3\u00D4\u00C1\u00F4C\u00C1\u0087\u009D2\u00B5\u00B2p\u00D9\u0088\u00EC\u008D#\u008B\x7FM\u00E7\u00BC=:\u0090\u00DB\u009D\u00D7r\u00ECF~MA\u00E9\u00F1\u00DC\u00C2\u00F4\x13\u00B4\u0093\u0094S\u00EE\u00A7\u00AD\u00CEh\x15\u00C9\x16\x0B\u00940\u0097|=;{n\u00A4\u00B4\u00BF\u00EC\u00C1\u00F9\u00EB\u00E5e\x15'/dU\u00A6^\u008C\u00BED\u00AA\u00F2\u00AC\u00DEs\u00D9\u00A6\u00C6\u00F0\u008A\u00F4U\u00B8:v\u00ED\u00FE\u00F5\u00E2Zz\u009D\u00D3\r\u00D5\u009B\u0098\u009BK\u00F5\u00FD\u00B7\u00AE\u00DC\u00CEm\u0088\u00BE\u00E3\u00DA\u00A8}\x17ww\u00A3i\u00AC\u00B9\u00B5\u00A5\u00EC^\u00DA}R+\u00F1\u00C1\u008E6\u00E6\u00B6\u00E9\u00F6\u00AE\u008E\u00EA\u00CE\u00CC.\u00D2C\u00A3G\"\u008F\u00D6\x1F\x0FtW\u00F5\u00E4\u00F6\u0096\u00F6u<\u0099z\u00CAx&\u00F2\\\x7F\u00C0g0\u00F5E\u00E9\u00CB\u009EW\u008B\u00AF\u00C5\u0086\u009DFr\u00DF<\x1D\u00E5\x1F\x0B\x18o\u00FE\u009B\u00FF]\u00FA\u00E4\u00D7\u00E9\u0083\u00B3\u0098\u00B9\u00CB\u00F3\u00CE\x1Fy?\u00BD^\u00AC\u00FB|\u00E6K\u00E1j\u00D9Z\u00FD\u00C6\u00DCw\u00FC\u00CF\u0080_i\f\x06\u00C0\u00F6\u00EC\x03\x00@\u00EB\x00\x14\u00C7\x01xM\x02\u00B8T\x01\x14l\x01(p\x02\u00E0j\x00\u009C\u00B9\x00\u00DC\u00F4\x01\u00D1Y\x00\u0088kY\u00800/\u00F8g~\x00\x00\x12X\u0081\x17$@\x05L\u00C0\r\" \x1B.\u00C2C\u0098E\u00B0#4\x10\u00BE\u0088\u00BF\x10M\u0088\x0FHq\u00A4;2\x1F\u00D9\u00C7\u00C4\u00CAd\u00CD\u0094\u00CB4\u0088\x12AQP\u00F5(\x06\u00B3\x13\u00F3E\u00E6ohg\u00F4U\x16\x14\x0B\u0089\u00A5\u009DU\u008A\u00F50\u00EB<\u009B\x03[=\u00BB\b{&\u00FB\x02\u0087'G'\u00A7\x06g\x19\x17\x0BW\x1C\u00D7\x14\u00C6\t\u00D3\u00CA\u00AD\u00C4]\u00CC\u00C3\u00C2\x13\u00C33\u00C9\u00EB\u00CC\u00DB\u00CA\u00A7\u00C4W\u00CC\u00CF\u00CC\x1F\u00C7?\u008Bu\u00C5v\b\x10\x04*p|\u00B8,\u00DC7\u00C1\b\u00C1wB\u00DEB\u00CF\u0085w\x0B\u00B7\u008B\u00EC\x12i\x14\u00D5\x11m\x113\x16\u00EB\x14\u00B7\x16\x1F\u0090\u00F0\u0092\u0098\u0095\u00A4K2\u00F0yR\x12R\u00B7\u00A5m\u00A4'eRd\u00B1\u00B2\u00F5;\u009Cw\u00AC\u00C8\x15\u00C9\x1B\u00CBO+\u00E4)\u00EA+\u00CE\u00ED<\u00ADd\u00A1\u00B4\u00AA\\\u00AD\u00E2\u00A7*\u00A4:\u00A0\u0096C\u00B0T\x07\u00F5V\u008DtMs-&\u00ADN\u00ED,\x1D{]\t=\u00A4\u00DE\u0092\u00FE\u00B0A\u00A7\u00E1\u00ED]UF\u00A7\u008C\u00B3L\x12L\u00C3\u00CC\u00C8\u00E6\u00FB\u0088\u00AE\x16\u00D6\u0096\u00E6V&\u00BBM\u00ADMmLmw\u00DB9\u00DB\u00FB8\x049\u00D2\u009C\x0E;\x17\u00ED\u00A9w\u00E9u\u009DtGx\u00C8{:x%xW\u00FA\f\u00FBr\u00EF3\u00F0#\u00FB\u009F\n\u00E8$\u00AD\u0092\u00E5)~AE\u00C1\u00FD\u00A1h\u00EA\u00EE\u00B0\u009C\u00F0\u00FEH\u009E(\u008F\u00E8\n\u00DAg\u00BAYLn\u00EC\u00DF\u00F1Z\t9\u0089c\u00C9*)GR\u00E7\u00D3,\u00D2\u00CB2~\x1C\u00F28\u00DC\u009C%\u0099\u009Dv\u00E4m\u008E\u00C9\u00D1;y\u00BE\u00F9b\x05C\u0085%'\x03O\u00CB\u009C\u00F9X\\w6\u00AD\u00D4\u00E1<\x7F\u00F9\u00E4\u0085\u00C6\u008B\u0085U\u0094\u00CB\u00D6WT\u00AFa\u00AF\u00FF\u00A8[\u00BA\u00F9\u00FE\u00D6L\u00C3D\u00E3|\u00D3\u00DA=\u00CEV\u00996\u00C7\u008E\u00E8\u00AE\u00F4G\x15\u00DD-\u00BD\x13OY\u009E\x11\x06\u00BC^\x1C\x7F\u00D53\u008C~C\x1C\u00CD\x1D\x1F{'7\u0095:3\u00F4~\u00E7\u0087\x03\u009F\u00A6\u0097l\u0097\u00AF\u00ACr\u00AC\u00C5l\u00CC|\u00B7\u00FAy\u009F\u00C1\u00D8\u00FEI\x00;\b\u0080,\u00E8\u0080=\x04\u00C1A\u00B8\x00]\u00F0\x01\u00C1\u00870FD\"\u00CA\x11CH.\u00A452\x1B\u00F9\u0098\u0089\u008D\u00C9\u0089\u00A9\u0088i\x12\u00A5\u0084JFu3\x0B1\u00872\u00B7\u00A01h*\u00BA\u009BE\u0091%\u0087\u00E5\x13\u00AB3k\x03\u009B\x04\u00DB\x11\u00B6/\u00EC>\u00EC=\x1C\u00DA\x1C\u0095\u009C|\u009C\u00879\u00D7\u00B9B\u00B8\u00DEb\u009C0\x1D\u00DC\u00DA\u00DCWydx\u00CE\u00F2\u00F2\u00F0\x1E\u00E1\u00FD\u00C5\x17\u00CF\u00B7\u00C2O\u00E5\u009F\u00C4\u00EE\u00C5\u00BE\x16p\x14\u00E8\u00C3Y\u00E1:\x04\u008D\x04\u009B\u0084t\u0085\u00EE\nk\n\u00D7\u0089\u00A8\u008B\u00DC\x10U\x17m\x123\x16\u00EB\x12\u00B7\x13\x1F\u0092\u00F0\u0097X\u0092L\u00C5\u00B3\u00E1\u008B\u00A5vJ\u00B5K\u00BBK/\u00C8d\u00CBJ\u00C86\u00EF\u00F0\u00D8\u00B1.W$o(?\u00AA\u0090\u00A1(\u00AF\u00F8|g\u00A2\x12^\u00A9G9FEJ\u00E5\u0095j\u00A6\u009A\u00A6\u00DA\f\u00A1H\u00DDZ}K\u00A3Q3JKVkD\u00FB\u00B8\u008E\u0083.Nw]oJ\u00FF\u0089A\u00A3\u00E1\u00E5]g\u008Dr\u008C\u0093M\"L\u00FD\u00CD<\u00CD\u00F7\x10\u00AD-\u008C,u\u00AD\u00B4vkY\u00EB\u00D8h\u00DB\x1A\u00D9Y\u00D9;;\u00F88\x06;%9\u00E7\u00ED\u00A9vis\x1Dv\u00DB\u00F0\x10\u00F74\u00F7\u008A\u00F4.\u00F6y\u00EA\u00CB\u00BC\u008F\u00E0\u00E7\u00E9\x7F$\u00A0\u00814E\u00C6R\u00AC\u0083\u00D2\u0082\u00EBC\u00E6\u00A82a\u00A4\u00F0\u00F2\u0088\u0089(\u00B1h\x7FZ\u00D5\u00FE\u00A5\x18\u008D\u00D8\u00A4\u00B8\u0087\t\u0098D\u008F\u00A4\u00D2\u00E4\u00D9T\u009D\x03\u00D9i/2$\x0FF\x1Cj\u00CE\u00E4\u00CA\"e\u00D7\x1D\u00F9\u009E\u00E3p\u00F4V\u009E\u00CD\u00B1\u00AD\u0082\u009AB\u00BF\u0093\u00C2\u00A7\u009E\u009E9\\\u00AC[\u00B2v\u00AE\u00B1,\u00AA\\\u00A1b\u00BE\u00F2\u00E6\u00A5\u0084j\u00D3\x1A\u00FE+\u00EF\u00AF\u00DD\u00AF=}#\u00BE>\u00F0\u00B6\u00DD\x1D\u009D\u00BB\u00EA\u00CD\u00AA\u00F7\u00B4Z\u008D\u00DA\u00BC:(]f\u008F\u00D4\u00BBEz9\u00FB\u00B6\u009En>[\x1A\u00F8\u00F0\u00E2\u00EB\u00AB\u009F\u00C3\x1CoDF\u00B5\u00C6=\u00FFN\u0099\u00AC\u009C~9\u0087\u009A\u00D7\u00FA\x18\u00BE\u00D0\u00B0\u00B4\u00F1\u00C5h\u00F5\u00E0\u00DA\u008BM\u00C5\u00EF\u00F4\u009F\u00AF\u00FE\u00F4\u009F\x03\x04A\x0E\u00F4\u00C1\tB!\x13\u00AA\u00A0\x1B\x16\x118\x04\x11\x11\u0083\u00A8FL \x05\u0091\u00EE\u00C8\"\u00E4\x04\u0093\x1CS,\u00D3c\u0094\x18*\x015\u00C4\u00AC\u00C7\\\u0081fG\u00A7\u00A0\x17YBY\u00A6X\x03X'\u00D8\u00F6\u00B1M\u00B0\x07\u00B2\u00CFrP9\u00969\x138\x19\\9\x18\x1C\u00A6\u0092[\u008D\u00BB\u008Dg\x0F\u00CF,\u00EF\x01>,_\x1D\u00BF\x03\u00FF\"\u00B6P@W`\f\u0097'\u00B8KpA\u00E8\u0092p\u00A0\u0088\u00AC\u00C8\u0090h\u00BE\u0098\u00B58B\u00BC]\"M\u00D2\x1C\u008F\u00C2wK\x1D\u0097\u00DE+\u00A3 \u00B3&\u00DB\u00B5\u00E3\u008C\\\u00B8<Q\x01\u00A7\u00F0E\u00F1\u00E9\u00CE\u00CBJ\x07\u0095}U\u008CU\u00A5\u00D5\u0098\u00D4f\t\u00BD\u00EA\u00B5\x1AE\u009A\x07\u00B5\u0082\u00B5\x1Duv\u00E9\u00AA\u00EB\u00E9\u00EA\x1B\x19\u0098\x1A\u00DA\u00EC\u00F24\"\x19\u0087\u009B\u00C4\u009B\x1E6;m~\u0099x\u00DB\u00A2\u00D3r\u00C8\u00EA\u00935\u00CAF\u00C8V\u00DB\u00CE\u00CD>\u00C6\u00E1\u0084c\u0083\u00D3\u00E8\x1E\u00B4\u008B\u0096\u00AB\u00BF[\u0081{\u00AF'\u00C2\u00CB\u00CC;\u00DD\u00A7\u00DBW`\u009F\u00BD_\u009A\x7FS\u00C0R\u00A0\"\u0099B\u00A9\x0E\u009A\x0F\u0091\x0B\u008D\u00A0\u00B6\u0084\u00A3\"\u00DC\"/D}\u00A5\u00D9\u00ED\u00AF\u00A63b\u00BD\u00E3\u009A\x13\u0084\x13\x13\u0092^\u00A4h\u00A5\u0096\u00A7\u00A1\u00D3C3\x06\x0Ei\x1D.\u00CF\u00C2d\u00C7\x1F\x19\u00CD\u00D9}\u00B4#\u00CF\u00E3\u00D8FAa\u00A1\u00E6\u0089\u00F1S\u00E9g\u00A4\u008B\x1E\u0095\u0084\u009F\x13-\u00ED8O\u00AE\u00E0\u00B8\u00D0|1\u00AC\n[\u00DDS\u0093qU\u00E7\u00DABm\u00D5\rJ\u00BD\u00E2\u00AD\u00A5\u0086\u00DA\u00C6\u00A4&\u00BB\x16\u0089{+\u00AD\u00CF\u00DA\u00EEv$u\u00CE?t|t\u00BF\u009B\u00D0s\u00B5O\u00E2\u00C9\u00C9~\u00F4\u00B3\u00A4\u00E7\u00AB\u0083\u00DE/\u009E\u00BD\u00D2\x1B*\x1F\u0086\x11\u00EF77GQc\u00EE\u00E3\u00E7'&\u00DE\u00C9N\u00FAN\x1D\u009B\u00BE732\u00BB\u00F6\x1E;\u00AF\u00F4\u00C1\u00F4\u00A3\u00E3'\u0097\x05\u00A7E\u0087%\u00DB\u00CF&\u00CB\x1A_\u00F0+\u00EC+\u009FW\x07\u00BF\u00D6\u00AD\u00E5\u00ADS7\u00CC7y6'\u00BE]\u00FF\u009E\u00FC\u00C3\u00E6\u00A7\u00E0\u00CF\u00F1\u00AD\u00B2_]\f\x06\u00C0\u00F6\u00BE\x04\x00\x00\u00EC\u00C4\u00E8\u0088h:\u00DE\u009Eh\x01\u00FF\u00BF\x12\x19\x11\u00F7\x0F\x07\x0F\x00pRcm\u00DC\x00\x00\x0B\x00\x03\u00C1t+\x17\x000\x07\u0080\u0099\u00A8@G'\x00\u00E0\x03@\u00C8\x05\u00C5X\u00BA\u00FE\u00C6z\u00C1T+\u009B\u00EDX\u0084--\u00D6\u00D9\r\x00\u0084\x00\x10>\u00C9\u00A1n\u009E\x00\u0080\x01@\u00D0\u00C3H\u00B6\u00CE\u00BFqFT\u0084\u00A3=\x00\u00E0\x00\x10\u00F9\u0094 \x0B\u00CB\u00DF\u00B1\u0097\u00E8q.\u00EE\x00 \x0B\u0080h\b\u008F\u00B6s\x01\x00N\x00\u00C4HP\u0094\u00FB?\\31\u00F1\u00AE\u00FF\u00F8\u00AFSH\x16v\x00 \x06\u0080D'\u0087\x12\x1D\u00B7\u00FD\u0091\u00D2`\x0FD\u00B0\x00<\u0090!\x1A\" \x1A\u00E8@\u0085^ \x03\x1DH\x10\x05xx\x07x \x03\x1D\u00A8\x10\x03\u00B1@\u00828H\x04<D\x00\x15\u00F6C\x1CP\u0081\x02A\x10\u00F3;>\x0E\" \b\u00E2\u0080\x0EV@\x02:\u0084@\x10\u00A8\u00FCf\u00F8\u00EF<\x1E0\x03t\u00A0\u00FE/\x1ET\u00A0@\u00B4?\u00F5\x10=\u00F2Vp|qt\u0092\u0081G(\u00E1\x1A\u00E1\x03\u00E1'\u00E0\x7F{\u00DB\u00FDa\f\u0082\u00A8?\u0099\u00B6\u00D9\x03\u00FF\u00D1Qr(\r\u00946\u00CA\x1Ce\u00842F\u00E9\x03\x1E\u0085C\u0089\u0080\nJ\x0B\u00A5\u00872C\u0099\u00A0\fQ\u00DA(\u00FDg\x0Bw\x17\u00FEd%\u00FE\u00A9\x00\u00FF'\u00E3\f\u00D0!\u00E4?jU\u0081` \x01\x1D\u00E2!\bb \x1C\u00E6\u0080\x0E\u0091\u00FE\u00D4C\u00FF\u00C6\u00C1\u00F6\u00AE\x0E\x00\u0080\u00E6\x01(\r\x00\x00h\u00DBL\u00C9\u00F8\u00CFw\x15\x1B\u0094\x18\x0B\x00@\u008C\u00A6%\u00D1\u00A9!\u00A1\u00B1x3\x1A-\"\bO\u008C\u008E\u00A4\u00C5\u00C5\x06\u00D1\u0095\u00F16QdUe\u00BC\x06\u0081\u00A0\r\x00\u00F0_\x14\u00F7T\u00A9\u00D4J\u008B\u00F2\x00\x00\x00 cHRM\x00\x00m\u0098\x00\x00s\u008E\x00\x00\u00E2\u00F9\x00\x00\u0086\u0099\x00\x00x\u0083\x00\x00\u00D4N\x00\x003\u00BC\x00\x00\x1Cyc\u00E1\x1F,\x00\x00\x00\u00A2IDATx\u00DA\u0094\u0091\u00B1\r\u00840\x10\x04\u00C7>\x07\u00D0\n=P\x07\x05\u0090\"\u008AA\u00A4\u00D4@\x05n\u00C3]\\\u008C\x03l\x7F\u00F0\x12\u00C9\x0B\u00F0_x\u00BA\u00DB\u00DD\u00D1\x1AU-)%D\x04\x11!\u00E7L)\u0085\u00DAq\x00\"\u0082\u00B5\u0096\u0094\u00D2\u00CF\u00C14M\u00B7\u00CF\u00EB\u00BAbT\u00B5\x18cn]\u009B\u00A6\u00B9\x15\u00881~\x13<E\u008E1\u00BE#\u00EC\u00FB\u008E\u00F7\u00FEZ\u00F6}\u00CF0\f\u00F5\b\u00CE9\u0096e!\u0084@\u00D7u\u00CC\u00F3\u00CCy\u009EU\bFU\x0B@\u00CE\u0099m\u00DB\x18\u00C7\x11kmu\x0B\u0097\x00@\u00DB\u00B6\x1C\u00C7\u00F1\x7F\x0BO\x0Eo\b\u009F\x01\x00\u009B\u00FDU\u00A2t\u00A1Hz\x00\x00\x00\x00IEND\u00AEB`\u0082"));
              // create a data folder for your script in the user's application data
              var myDataFolder = new Folder( Folder.userData.absoluteURI + "/SampleScripts" );
              // make certain the folder exists
              myDataFolder.create();
              // write the image file
              var myFile = new File( myDataFolder.absoluteURI + "/myFile.png" );
              myFile.encoding = "BINARY";
              myFile.open( "w" );
              myFile.write( myBinary );
              myFile.close();
              // there is now a valid png image in your script's user data folder
         // example of using ScriptUI's drawing api to make a dropdownlist draw as an icon (until the user clicks it, then it's a menu)
         myFlyout = function( palette ) {
              palette.myFlyout = palette.add( "dropdownlist", [ ( palette.frameSize.width - 20 ), 0, palette.frameSize.width, 20 ] );
              palette.myFlyout.onDraw = function() {
                   this.graphics.drawImage( ScriptUI.newImage( myIconFile ), 0, 0 );
              if ( !palette.onShow ) {
                   palette.onShow = function() {
                        this.myFlyout.draw( this );
         // A slightly more complex example putting it all together where you can pass a callback function and an array of menu items
        // this function will add a flyout menu to the top-right corner of any ScriptUI window. It does not need to be a palette.
         addFlyout = function( palette, menuItems, callback ) {
              // create a script data folder to contain resources such as the flyout icon
              var myScriptDataFolder = new Folder( Folder.userData.absoluteURI + "/SampleScripts" );
              myScriptDataFolder.create();
              // point a file to the expected location of the icon image
              var myFlyoutIcon = new File( myScriptDataFolder.absoluteURI + "/flyoutIcon.png" );
              if ( !myFlyoutIcon.exists ) { // if it's not there, then create the file
                   var binData = (new String("\u0089PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\t\b\x06\x00\x00\x00;*\u00AC2\x00\x00\x00\tpHYs\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\u009A\u009C\x18\x00\x00\x0FciCCPPhotoshop ICC profile\x00\x00x\u00DA\u00ADWi8\x14\u00EC\u00D7?3\u00C6\u00D8\u00C76\u00C6\u00CEX\u00B2d\x1B\u00FB\u0096u\u0090\u009D\u00EC$\u008C\x19\u00CBX\u00A7\u00B1/\u00A1B\u008F\u0088\u00B4\u00A1\u0088\x14i\u00A1\u0094\u0084\u0092\u00AD\u00B2\u0094\u00A2\x12ey\u00B2\u00A6B\"K\u008B\u00E6\u00FD\u00A0\u00A7\u00E7\u00BA\u00FE\u00EF\u00F5\u00BE\u00EF\u0097\u00F7|\u00FA\u009Ds\u009Ds~\u00E7\u00BE\u00CF}]\u00E7>\x00\u00BCB$\x1A-\x02\t\x00\u0091Q\u00B1t\u0097\u00DD\u00E6x/o\x1F<\u00CBk\u00E0\x04~\u00C0\u0082>H\u0092\u00C8143gg{\u00F8\x1Fe\u00FD5 \x00\x00^\u00AA\u0090h\u00B4\u0088|\u00F6\x00J\u00DF\u00D4\u00D9\u0092z\u00C3\x15\u00E7/\u00B2\u0087d\u00E1\x7F\x17\f\u00DD\u00CB\u00DB\x07\x00\u00A1\f\x00\u00D8\u0090ml\n\x00\u00D8\u00C0m\u00EC\x06\x00\u00D8\u0084XZ,\x00\"\x14\x00\u00B0\u00E4P\x12\x05\x00\u0091\n\x00\u00CAt7\x17\"\x00\u00A2\x06\x000!\u00DB\u00B8\t\x000\u0081\u00DB\u00B8\x07\x000\u00F1\u00E4\u0090X\x00\u00C4\b\x00\u009A/\u008AB\u008D\x02`Y\x00@\x1BS\u0082b\u00C8\x00\x18e\x00\u00A0Pb\u00C8\u0091\x00\u0098\u00E3\x00H\u00D5\u00C8\u00C8h\n\x00O;\x00(\u0090i\u00F4X\x00\u009Ey\x00P\u00F1\u00F2\u00F6\u00C1o\u0097L\u00D9\x000@\x01\u00A0\u00DF\u00FEk\x0B\u0093\x02\u00A8\u00BD\x03 &\u00F5\u00AFM\u00FE\x01\u0080\x10\t\u00E0\u00E6\u00CE\x7Fm\u00AB.\u0080\x00\x00\x04\u00EEyL\u00B0\u00A6\x06\x00\x00 8\u00CD\x01\u0098'\x18\u008CU9\x00\u0096\x13\x00[\u0085\f\u00C6\u008FJ\x06c\u00EB\"\x00\u00D3\x18@{\x049\u008E\x1E\u00FF\u00FB\u00BE\x10\u0088~\u0080\u00FFK\u00DF>\u00F3oaB\x00 \x01\u0090jL\u008E\u00A8P\u00E6\x03\u00E8\x12\u0096\u009B\u00AC\u009Dl#\u00EC\u009F8V\u00B8\u00D81\u0082\u00DCR<*\u00BC\x06|f\u00FC\u00F6X7\x01O\u009C\u009F Y\u0088*L\x13\u0089\x11\u008D\x15\u008B\x13O\u0094H\u0091\u00CC\u00C0gJeJ\x1F\u00919*\u009B\u00BF\u00E3\u00B4\u00DC9\u00F9\n\u0085\x1A\u00C5\x1B;\u009B\u0094\u00BA\u0095\u0087T&U\u00D7\t\u00EC\u00EA\u00D2\x1A\u009A\u009A\u00EEZ)\u00DA\x15:}\u00BA\u009B\u00FA\u008A\x06$\u00C3s\u00BB\u00C6\u008D%M\u00A8\u00A6w\u00CD9\u0089\u00FB,n[\u00F1\u00ED\u00A6[\x0F\u00DA\u00AA\u00D9\x1D\u00B3\u00FF\u00E2h\u00EFT\u00B7\u0087\u00DB%\u00C2\u00B5\u00CF]\u00D4#\u00C2\u00F3\u00817\u00C6\u00C7\x7Fo\u008D\u00EFW?\u00A2\u00FF\u00D1\u0080\u00FE@n\u00B2\x13\u00E5D\u00D0\u00F3\x10\u00F6P3j\\X]\u00F8d$\x7F\u0094Et\x02\u00ED\u00FA\u00FE\u00B71\u00A8XB\u009C\x7F|^\u00C2\u00FD\u00C4\u00F9d\u00DE\x14\u00E3T\u00DA\u0081\u00F2\u00B4\u00EE\u00F4\u00B1\u008C\u00A9\u0083\u00B3\u0087\x16\x0E/g\u00AEd\u00ADgo\u00FD\u0085\u00CA\u00E1<\u00CA\u009B+\u0090'~L!_\u00B3\u00C0\u00F0\u00B8Y\u00A1\u00F5\u0089='=N\u00F9\u009C\u00F6;C.\u00A2\x16\u0087\u0097\u0084\u009F\u00A5\u009E\u00A3\u0096\u0086\u0095\u0085\u009E'\u0095\u00FBT\u00B8^\u00B0\u00AB4\u00BD\u00A8~I\u00B1J\u00BEz\u00C7e\u00E9\x1A\u00FC\x15\u00F1\u00AB\u00C2\u00D7\x04\u00AE\u00F3\u00D6\u00F2\u00D4q\u00DE`\u00BE\u00F1\u00EB\u00E6f\u00FD\u00EA\u00AD\u00C5\u00DB\u00B3\r\u00A3w\x06\x1B\u009F\u00DE\u00EDjjn\u00AEo\u00B9~\u00EF\u00CA\u00FD\x0B\u00ADg\x1E\u00E4\u00B7\x1Dm\u00CF\u00EC8\u00D8\u0099\u00DCE\x7F\x18\u00F5(\u00EAqD7\u00A9\u0087\u00D8\u008B\u00EB\u009D\u00EA\u00BB\u00F5$\u00FD\u00A9m\u00BF`\u00FF\u00DC\u00B3\u0086\u00E7\u0099\x03.\u0083\u0092\u0083\u008B/\u00DA_\x16\u00BE\u00F2\x1FR\x19\u00FA\u00FE\u00FA\u00C9p\u00D1\b\u00E9\u008D\u00CA\u009Boo\x1F\u008F\x16\u008Cy\u008C\u008B\u008F\u00CFL\u00D4\u00FEM\x7F\u00A7\u00F3\u00EE\u00DBd\u00CBT\u00CA\u00B4\u00C1\u00F4\u00FAL\u00E3l\u00EA\u009C\u00D9{\u00A6\u00F7\u00BD\u00F3y\x1F\x1C?\u00F2||\u00F9\u00A9h\u00C1kQhqd\u00A9\u00F8\u00B3\u00D7\u00B2\u00D0\u00F2\u00D0\u0097\u00C2\x15\u00C7U\u00AE\u00D5\u00DE\u00AF\u0099kfk\u008C\u00F5\x07\x1B\u00C9\u009B\u00DA\u009B\u00CB\u00DFj\u00BF\u0087\u00FFP\u00FC1\u00F7\u00B3r+\u00E0\u0097\u00E4\u00AF\u00B7\u008C\u00FD\f\x06\x00\x12\u00C5\u00C4\u0087\u00C21c\u00D1\x02,\u00DC\u00AC\x1Cl\u00ACl[\u00EC\u00DF8>s\u00CEp\u00BD\u00C1\u00F4sw\u00F0\u00D4\u00F3V\u00F2\u009D\u00E2\u00CF\u00C2&\b\u0084\u00E3\u00F6\t:\t\x11\u0085\u00F5EtD\u0095\u00C5\u00D4\u00C4U%t$\u008D\u00F1\u0096R&\u00D2z2*\u00B2\u00CA;\u0094\u00E5v\u00CA\x13\x14\u0094\x15\t;u\u0094\u0088\u00CA\u00B6*^\u00AAT\u00B5$B\u008Ez\u0099F\u00A3\u00E6s\u00AD%\x1D^]-=W\u00FDd\u0083\u00CB\u0086\u00C3F\u00AC\u00C6\u00DA&\u00FBMk\u00CD\u00E6\u0089J\x16\u00E1\u00967\u00AC6\u00AD-mrmG\u00EC\u00D5\x1DR\x1D\x07\u009DE\u00F7\u0084\u00B84\u00BA!\u00DC\x1D<Nx\u008Ey+\u00FA\u00D0\u00F6\u00DE\u00F2\u00DD\u00F0\u00D3\u00F3?\x10\u00D0F\u00DA\"\x1BR\u00E2\u0083\u00EE\x06\u00AF\u0086\u00AAR\u00C3\u00C2\u00AE\u0086\x7F\u008C\u0094\u008B\u00F2\u008D.\u00A6\u00BD\u00A6\u00F3\u00C7\u00B8\u00C5\x16\u00C6\u00F5%\u00B0&\u00DA'\u00E5'?J\u0099N\u00FDt\u00E0s\u00DAZ\u00FA\u00B7\u008C\u00EF\x07\x7F\x1Df\u00CE\u00E4\u00CC\u00E2\u00CF\x16>\"\u00FE\u0097l\x0E\u00E1\u00A8A\u00AEy\u009E\u00CD1\u00A7|\u00AF\x02\u00DF\u00E3\x01\u0085\u0094\x13a'\u00A3O\u00D1N\u00D3\u00CFD\x17E\x15\u00D3J\"\u00CF\x06\u009F\x0B(\u00F5*s>oY\u00AES\u00A1rA\u00A5R\u00F9\u00A2\u00E2%\u00C5*\u0085j\u00B9\u00CB\u00B252Wd\u00AF\u00CA\\\u0093\u00BC.V+R'|C\u00E8\u00A6@=\u00DF-\u00EE\u00DB\u00DC\r\u0098;\\\u008D\\wy\u009Bp\u00CDB-B\u00F7D\u00EF\u00E3[\u00E5\x1F\u00A8\u00B6i\u00B7\u00EBw\u0098w:v\u00F9<\u00DC\u00FBh\u00F7c\u00FC\u00E3\u0095\u00EE\u00DE\u009E\u00D2\u00DE\u00C8>\u00B3'\u0082O\x16\u009F>\u00EA/y\x16\u00F9\u009C8 >\u00B0>\u00D8\u00FF\u00A2\u00F2e\u00C2+\u00C7!\u00E9\u00A1\u00B5\u00D7\u00BD\u00C3\u00A5#\u00D1o\u00CC\u00DE\u00F2\u00BE\x1D\x1F\u00BD>\u0096:n=\u00C1;1\u00FAw\u00E5\u00BB\u00B0I\u00D5\u00C9\u00E5\u00A9\u00A6\u00E9\u00E33\u00A1\u00B3&s\u0082s\u008B\u00EF\x1F\u00CE\u0097|\u0088\u00FAh\u00F9I\u00F8\u00D3\u00C7\u0085\u00FB\u008B\u00C7\u0096\u00F6}V\u00FD\u00FCc\u00B9\u00FB\u00CB\u0089\x15\u00BFU\u00C5\u00D5\u0095\u00AF\u00F7\u00D6\u00B2\u00D7\u009D7\u00846\u00C66+\u00BFQ\u00BF\x13\u00BEo\u00FE\u00B8\u00FF3c\u00CB\u00F2\x17\u00E6\u00D7sF\u00E4v\u00FF\u0091\x1BL\u00CB\u00A8\u00AF\u00CC\u009F\u00D1\u008B,\u008B\u00AC\u008Bl\x13\u00EC\u00A3\x1C\u00AF8\u009Fp\u00B5b\u00EA\u00B8\u00CByry\x13\u00F8(\u00FC\u00F6X\u0082\x00\u00B7\u00C0*nP\u00F0\u009AP\u00A6\u00B0\u00AF\bA\u0094YtX\u00ACJ<N\u00C2R\u0092[r\x1C_%\x15)m \u0083\u0096y-{eG\u009A\u009C\u00BB\u00BC\u00B2\x02\u00AB\u00C2{\u00C5\u00EE\u009D5J\u00C7\u0094cU\u00F6\u00AA\u009A\u00AB\u00A9\x12\u00C4\u00D4\u00D9\u00D474f5\x07\u00B5\u00DA\u00B5o\u00EA\u0094\u00E9\u00E6\u00E8\u00C5\u00EB\u0093\f\u00EC\rw\u00ED\u00C2\x1B\u00A1\u008D\u0096\u008D\u0087L\u00EE\u0098\u009E4\u008B7\u00A7\x12=-\u00AC,\u00F5\u00AC\u00E4v\x0BY3[\u00AF\u00DB|\u00B0}c\u00D7c\u00DF\u00E8P\u00EDX\u00EC\u0094\u00E3\u009C\u00B8'\u00C4\u00C5\u00C3\u00D5\u00DE\u00CD\u00D0]\u00D9C\u00D2\x13\u00E7\u00C5\u00E5\u008D\u00F4\u00FE\u00EA\u00F3a\u00EF\u0094\u00EF\u00DB}\u00AF\u00FC\u00FA\u00FD\u00BB\x02\x1E\u0090Z\x03[\u00C8\u00B7(\x17\u0083r\u0082\u00E9!\u00FE\u00A1\u00D6T\u00B50\u0091p\u0096\u00F0\u00B5\u0088\u0099\u00C8\u00C1\u00A8\x07\u00D1u\u00B4\u00CA\u00FDg\u00E8\x7F\u00C5$\u00C6\u0086\u00C6\u00F9\u00C5;&\x18'\u00AA%I%cSP)\u00AB\u00A9\u00EF\x0E<K{\u0090~-\u00E3\u00D4\u00C1\u00F4C\u00C1\u0087\u009D2\u00B5\u00B2p\u00D9\u0088\u00EC\u008D#\u008B\x7FM\u00E7\u00BC=:\u0090\u00DB\u009D\u00D7r\u00ECF~MA\u00E9\u00F1\u00DC\u00C2\u00F4\x13\u00B4\u0093\u0094S\u00EE\u00A7\u00AD\u00CEh\x15\u00C9\x16\x0B\u00940\u0097|=;{n\u00A4\u00B4\u00BF\u00EC\u00C1\u00F9\u00EB\u00E5e\x15'/dU\u00A6^\u008C\u00BED\u00AA\u00F2\u00AC\u00DEs\u00D9\u00A6\u00C6\u00F0\u008A\u00F4U\u00B8:v\u00ED\u00FE\u00F5\u00E2Zz\u009D\u00D3\r\u00D5\u009B\u0098\u009BK\u00F5\u00FD\u00B7\u00AE\u00DC\u00CEm\u0088\u00BE\u00E3\u00DA\u00A8}\x17ww\u00A3i\u00AC\u00B9\u00B5\u00A5\u00EC^\u00DA}R+\u00F1\u00C1\u008E6\u00E6\u00B6\u00E9\u00F6\u00AE\u008E\u00EA\u00CE\u00CC.\u00D2C\u00A3G\"\u008F\u00D6\x1F\x0FtW\u00F5\u00E4\u00F6\u0096\u00F6u<\u0099z\u00CAx&\u00F2\\\x7F\u00C0g0\u00F5E\u00E9\u00CB\u009EW\u008B\u00AF\u00C5\u0086\u009DFr\u00DF<\x1D\u00E5\x1F\x0B\x18o\u00FE\u009B\u00FF]\u00FA\u00E4\u00D7\u00E9\u0083\u00B3\u0098\u00B9\u00CB\u00F3\u00CE\x1Fy?\u00BD^\u00AC\u00FB|\u00E6K\u00E1j\u00D9Z\u00FD\u00C6\u00DCw\u00FC\u00CF\u0080_i\f\x06\u00C0\u00F6\u00EC\x03\x00@\u00EB\x00\x14\u00C7\x01xM\x02\u00B8T\x01\x14l\x01(p\x02\u00E0j\x00\u009C\u00B9\x00\u00DC\u00F4\x01\u00D1Y\x00\u0088kY\u00800/\u00F8g~\x00\x00\x12X\u0081\x17$@\x05L\u00C0\r\" \x1B.\u00C2C\u0098E\u00B0#4\x10\u00BE\u0088\u00BF\x10M\u0088\x0FHq\u00A4;2\x1F\u00D9\u00C7\u00C4\u00CAd\u00CD\u0094\u00CB4\u0088\x12AQP\u00F5(\x06\u00B3\x13\u00F3E\u00E6ohg\u00F4U\x16\x14\x0B\u0089\u00A5\u009DU\u008A\u00F50\u00EB<\u009B\x03[=\u00BB\b{&\u00FB\x02\u0087'G'\u00A7\x06g\x19\x17\x0BW\x1C\u00D7\x14\u00C6\t\u00D3\u00CA\u00AD\u00C4]\u00CC\u00C3\u00C2\x13\u00C33\u00C9\u00EB\u00CC\u00DB\u00CA\u00A7\u00C4W\u00CC\u00CF\u00CC\x1F\u00C7?\u008Bu\u00C5v\b\x10\x04*p|\u00B8,\u00DC7\u00C1\b\u00C1wB\u00DEB\u00CF\u0085w\x0B\u00B7\u008B\u00EC\x12i\x14\u00D5\x11m\x113\x16\u00EB\x14\u00B7\x16\x1F\u0090\u00F0\u0092\u0098\u0095\u00A4K2\u00F0yR\x12R\u00B7\u00A5m\u00A4'eRd\u00B1\u00B2\u00F5;\u009Cw\u00AC\u00C8\x15\u00C9\x1B\u00CBO+\u00E4)\u00EA+\u00CE\u00ED<\u00ADd\u00A1\u00B4\u00AA\\\u00AD\u00E2\u00A7*\u00A4:\u00A0\u0096C\u00B0T\x07\u00F5V\u008DtMs-&\u00ADN\u00ED,\x1D{]\t=\u00A4\u00DE\u0092\u00FE\u00B0A\u00A7\u00E1\u00ED]UF\u00A7\u008C\u00B3L\x12L\u00C3\u00CC\u00C8\u00E6\u00FB\u0088\u00AE\x16\u00D6\u0096\u00E6V&\u00BBM\u00ADMmLmw\u00DB9\u00DB\u00FB8\x049\u00D2\u009C\x0E;\x17\u00ED\u00A9w\u00E9u\u009DtGx\u00C8{:x%xW\u00FA\f\u00FBr\u00EF3\u00F0#\u00FB\u009F\n\u00E8$\u00AD\u0092\u00E5)~AE\u00C1\u00FD\u00A1h\u00EA\u00EE\u00B0\u009C\u00F0\u00FEH\u009E(\u008F\u00E8\n\u00DAg\u00BAYLn\u00EC\u00DF\u00F1Z\t9\u0089c\u00C9*)GR\u00E7\u00D3,\u00D2\u00CB2~\x1C\u00F28\u00DC\u009C%\u0099\u009Dv\u00E4m\u008E\u00C9\u00D1;y\u00BE\u00F9b\x05C\u0085%'\x03O\u00CB\u009C\u00F9X\\w6\u00AD\u00D4\u00E1<\x7F\u00F9\u00E4\u0085\u00C6\u008B\u0085U\u0094\u00CB\u00D6WT\u00AFa\u00AF\u00FF\u00A8[\u00BA\u00F9\u00FE\u00D6L\u00C3D\u00E3|\u00D3\u00DA=\u00CEV\u00996\u00C7\u008E\u00E8\u00AE\u00F4G\x15\u00DD-\u00BD\x13OY\u009E\x11\x06\u00BC^\x1C\x7F\u00D53\u008C~C\x1C\u00CD\x1D\x1F{'7\u0095:3\u00F4~\u00E7\u0087\x03\u009F\u00A6\u0097l\u0097\u00AF\u00ACr\u00AC\u00C5l\u00CC|\u00B7\u00FAy\u009F\u00C1\u00D8\u00FEI\x00;\b\u0080,\u00E8\u0080=\x04\u00C1A\u00B8\x00]\u00F0\x01\u00C1\u00870FD\"\u00CA\x11CH.\u00A452\x1B\u00F9\u0098\u0089\u008D\u00C9\u0089\u00A9\u0088i\x12\u00A5\u0084JFu3\x0B1\u00872\u00B7\u00A01h*\u00BA\u009BE\u0091%\u0087\u00E5\x13\u00AB3k\x03\u009B\x04\u00DB\x11\u00B6/\u00EC>\u00EC=\x1C\u00DA\x1C\u0095\u009C|\u009C\u00879\u00D7\u00B9B\u00B8\u00DEb\u009C0\x1D\u00DC\u00DA\u00DCWydx\u00CE\u00F2\u00F2\u00F0\x1E\u00E1\u00FD\u00C5\x17\u00CF\u00B7\u00C2O\u00E5\u009F\u00C4\u00EE\u00C5\u00BE\x16p\x14\u00E8\u00C3Y\u00E1:\x04\u008D\x04\u009B\u0084t\u0085\u00EE\nk\n\u00D7\u0089\u00A8\u008B\u00DC\x10U\x17m\x123\x16\u00EB\x12\u00B7\x13\x1F\u0092\u00F0\u0097X\u0092L\u00C5\u00B3\u00E1\u008B\u00A5vJ\u00B5K\u00BBK/\u00C8d\u00CBJ\u00C86\u00EF\u00F0\u00D8\u00B1.W$o(?\u00AA\u0090\u00A1(\u00AF\u00F8|g\u00A2\x12^\u00A9G9FEJ\u00E5\u0095j\u00A6\u009A\u00A6\u00DA\f\u00A1H\u00DDZ}K\u00A3Q3JKVkD\u00FB\u00B8\u008E\u0083.Nw]oJ\u00FF\u0089A\u00A3\u00E1\u00E5]g\u008Dr\u008C\u0093M\"L\u00FD\u00CD<\u00CD\u00F7\x10\u00AD-\u008C,u\u00AD\u00B4vkY\u00EB\u00D8h\u00DB\x1A\u00D9Y\u00D9;;\u00F88\x06;%9\u00E7\u00ED\u00A9vis\x1Dv\u00DB\u00F0\x10\u00F74\u00F7\u008A\u00F4.\u00F6y\u00EA\u00CB\u00BC\u008F\u00E0\u00E7\u00E9\x7F$\u00A0\u00814E\u00C6R\u00AC\u0083\u00D2\u0082\u00EBC\u00E6\u00A82a\u00A4\u00F0\u00F2\u0088\u0089(\u00B1h\x7FZ\u00D5\u00FE\u00A5\x18\u008D\u00D8\u00A4\u00B8\u0087\t\u0098D\u008F\u00A4\u00D2\u00E4\u00D9T\u009D\x03\u00D9i/2$\x0FF\x1Cj\u00CE\u00E4\u00CA\"e\u00D7\x1D\u00F9\u009E\u00E3p\u00F4V\u009E\u00CD\u00B1\u00AD\u0082\u009AB\u00BF\u0093\u00C2\u00A7\u009E\u009E9\\\u00AC[\u00B2v\u00AE\u00B1,\u00AA\\\u00A1b\u00BE\u00F2\u00E6\u00A5\u0084j\u00D3\x1A\u00FE+\u00EF\u00AF\u00DD\u00AF=}#\u00BE>\u00F0\u00B6\u00DD\x1D\u009D\u00BB\u00EA\u00CD\u00AA\u00F7\u00B4Z\u008D\u00DA\u00BC:(]f\u008F\u00D4\u00BBEz9\u00FB\u00B6\u009En>[\x1A\u00F8\u00F0\u00E2\u00EB\u00AB\u009F\u00C3\x1CoDF\u00B5\u00C6=\u00FFN\u0099\u00AC\u009C~9\u0087\u009A\u00D7\u00FA\x18\u00BE\u00D0\u00B0\u00B4\u00F1\u00C5h\u00F5\u00E0\u00DA\u008BM\u00C5\u00EF\u00F4\u009F\u00AF\u00FE\u00F4\u009F\x03\x04A\x0E\u00F4\u00C1\tB!\x13\u00AA\u00A0\x1B\x16\x118\x04\x11\x11\u0083\u00A8FL \x05\u0091\u00EE\u00C8\"\u00E4\x04\u0093\x1CS,\u00D3c\u0094\x18*\x015\u00C4\u00AC\u00C7\\\u0081fG\u00A7\u00A0\x17YBY\u00A6X\x03X'\u00D8\u00F6\u00B1M\u00B0\x07\u00B2\u00CFrP9\u00969\x138\x19\\9\x18\x1C\u00A6\u0092[\u008D\u00BB\u008Dg\x0F\u00CF,\u00EF\x01>,_\x1D\u00BF\x03\u00FF\"\u00B6P@W`\f\u0097'\u00B8KpA\u00E8\u0092p\u00A0\u0088\u00AC\u00C8\u0090h\u00BE\u0098\u00B58B\u00BC]\"M\u00D2\x1C\u008F\u00C2wK\x1D\u0097\u00DE+\u00A3 \u00B3&\u00DB\u00B5\u00E3\u008C\\\u00B8<Q\x01\u00A7\u00F0E\u00F1\u00E9\u00CE\u00CBJ\x07\u0095}U\u008CU\u00A5\u00D5\u0098\u00D4f\t\u00BD\u00EA\u00B5\x1AE\u009A\x07\u00B5\u0082\u00B5\x1Duv\u00E9\u00AA\u00EB\u00E9\u00EA\x1B\x19\u0098\x1A\u00DA\u00EC\u00F24\"\x19\u0087\u009B\u00C4\u009B\x1E6;m~\u0099x\u00DB\u00A2\u00D3r\u00C8\u00EA\u00935\u00CAF\u00C8V\u00DB\u00CE\u00CD>\u00C6\u00E1\u0084c\u0083\u00D3\u00E8\x1E\u00B4\u008B\u0096\u00AB\u00BF[\u0081{\u00AF'\u00C2\u00CB\u00CC;\u00DD\u00A7\u00DBW`\u009F\u00BD_\u009A\x7FS\u00C0R\u00A0\"\u0099B\u00A9\x0E\u009A\x0F\u0091\x0B\u008D\u00A0\u00B6\u0084\u00A3\"\u00DC\"/D}\u00A5\u00D9\u00ED\u00AF\u00A63b\u00BD\u00E3\u009A\x13\u0084\x13\x13\u0092^\u00A4h\u00A5\u0096\u00A7\u00A1\u00D3C3\x06\x0Ei\x1D.\u00CF\u00C2d\u00C7\x1F\x19\u00CD\u00D9}\u00B4#\u00CF\u00E3\u00D8FAa\u00A1\u00E6\u0089\u00F1S\u00E9g\u00A4\u008B\x1E\u0095\u0084\u009F\x13-\u00ED8O\u00AE\u00E0\u00B8\u00D0|1\u00AC\n[\u00DDS\u0093qU\u00E7\u00DABm\u00D5\rJ\u00BD\u00E2\u00AD\u00A5\u0086\u00DA\u00C6\u00A4&\u00BB\x16\u0089{+\u00AD\u00CF\u00DA\u00EEv$u\u00CE?t|t\u00BF\u009B\u00D0s\u00B5O\u00E2\u00C9\u00C9~\u00F4\u00B3\u00A4\u00E7\u00AB\u0083\u00DE/\u009E\u00BD\u00D2\x1B*\x1F\u0086\x11\u00EF77GQc\u00EE\u00E3\u00E7'&\u00DE\u00C9N\u00FAN\x1D\u009B\u00BE732\u00BB\u00F6\x1E;\u00AF\u00F4\u00C1\u00F4\u00A3\u00E3'\u0097\x05\u00A7E\u0087%\u00DB\u00CF&\u00CB\x1A_\u00F0+\u00EC+\u009FW\x07\u00BF\u00D6\u00AD\u00E5\u00ADS7\u00CC7y6'\u00BE]\u00FF\u009E\u00FC\u00C3\u00E6\u00A7\u00E0\u00CF\u00F1\u00AD\u00B2_]\f\x06\u00C0\u00F6\u00BE\x04\x00\x00\u00EC\u00C4\u00E8\u0088h:\u00DE\u009Eh\x01\u00FF\u00BF\x12\x19\x11\u00F7\x0F\x07\x0F\x00pRcm\u00DC\x00\x00\x0B\x00\x03\u00C1t+\x17\x000\x07\u0080\u0099\u00A8@G'\x00\u00E0\x03@\u00C8\x05\u00C5X\u00BA\u00FE\u00C6z\u00C1T+\u009B\u00EDX\u0084--\u00D6\u00D9\r\x00\u0084\x00\x10>\u00C9\u00A1n\u009E\x00\u0080\x01@\u00D0\u00C3H\u00B6\u00CE\u00BFqFT\u0084\u00A3=\x00\u00E0\x00\x10\u00F9\u0094 \x0B\u00CB\u00DF\u00B1\u0097\u00E8q.\u00EE\x00 \x0B\u0080h\b\u008F\u00B6s\x01\x00N\x00\u00C4HP\u0094\u00FB?\\31\u00F1\u00AE\u00FF\u00F8\u00AFSH\x16v\x00 \x06\u0080D'\u0087\x12\x1D\u00B7\u00FD\u0091\u00D2`\x0FD\u00B0\x00<\u0090!\x1A\" \x1A\u00E8@\u0085^ \x03\x1DH\x10\x05xx\x07x \x03\x1D\u00A8\x10\x03\u00B1@\u00828H\x04<D\x00\x15\u00F6C\x1CP\u0081\x02A\x10\u00F3;>\x0E\" \b\u00E2\u0080\x0EV@\x02:\u0084@\x10\u00A8\u00FCf\u00F8\u00EF<\x1E0\x03t\u00A0\u00FE/\x1ET\u00A0@\u00B4?\u00F5\x10=\u00F2Vp|qt\u0092\u0081G(\u00E1\x1A\u00E1\x03\u00E1'\u00E0\x7F{\u00DB\u00FDa\f\u0082\u00A8?\u0099\u00B6\u00D9\x03\u00FF\u00D1Qr(\r\u00946\u00CA\x1Ce\u00842F\u00E9\x03\x1E\u0085C\u0089\u0080\nJ\x0B\u00A5\u00872C\u0099\u00A0\fQ\u00DA(\u00FDg\x0Bw\x17\u00FEd%\u00FE\u00A9\x00\u00FF'\u00E3\f\u00D0!\u00E4?jU\u0081` \x01\x1D\u00E2!\bb \x1C\u00E6\u0080\x0E\u0091\u00FE\u00D4C\u00FF\u00C6\u00C1\u00F6\u00AE\x0E\x00\u0080\u00E6\x01(\r\x00\x00h\u00DBL\u00C9\u00F8\u00CFw\x15\x1B\u0094\x18\x0B\x00@\u008C\u00A6%\u00D1\u00A9!\u00A1\u00B1x3\x1A-\"\bO\u008C\u008E\u00A4\u00C5\u00C5\x06\u00D1\u0095\u00F16QdUe\u00BC\x06\u0081\u00A0\r\x00\u00F0_\x14\u00F7T\u00A9\u00D4J\u008B\u00F2\x00\x00\x00 cHRM\x00\x00m\u0098\x00\x00s\u008E\x00\x00\u00E2\u00F9\x00\x00\u0086\u0099\x00\x00x\u0083\x00\x00\u00D4N\x00\x003\u00BC\x00\x00\x1Cyc\u00E1\x1F,\x00\x00\x00\u00A2IDATx\u00DA\u0094\u0091\u00B1\r\u00840\x10\x04\u00C7>\x07\u00D0\n=P\x07\x05\u0090\"\u008AA\u00A4\u00D4@\x05n\u00C3]\\\u008C\x03l\x7F\u00F0\x12\u00C9\x0B\u00F0_x\u00BA\u00DB\u00DD\u00D1\x1AU-)%D\x04\x11!\u00E7L)\u0085\u00DAq\x00\"\u0082\u00B5\u0096\u0094\u00D2\u00CF\u00C14M\u00B7\u00CF\u00EB\u00BAbT\u00B5\x18cn]\u009B\u00A6\u00B9\x15\u00881~\x13<E\u008E1\u00BE#\u00EC\u00FB\u008E\u00F7\u00FEZ\u00F6}\u00CF0\f\u00F5\b\u00CE9\u0096e!\u0084@\u00D7u\u00CC\u00F3\u00CCy\u009EU\bFU\x0B@\u00CE\u0099m\u00DB\x18\u00C7\x11kmu\x0B\u0097\x00@\u00DB\u00B6\x1C\u00C7\u00F1\x7F\x0BO\x0Eo\b\u009F\x01\x00\u009B\u00FDU\u00A2t\u00A1Hz\x00\x00\x00\x00IEND\u00AEB`\u0082"));
                   myFlyoutIcon.encoding = "BINARY";
                   myFlyoutIcon.open( "w" );
                   myFlyoutIcon.write( binData );
                   myFlyoutIcon.close();
               } // the above code to create the file should only execute once for each user on the machine
              palette._flyoutMenu = {}; // this object will hold the menu related stuff - prefaced with an underscore to avoid naming collisions
              palette._flyoutMenu.items = menuItems;
              palette._flyoutMenu.callback = callback;
              palette._flyoutMenu.draw = function( palette ) { // actually draw the menu          
                   // add the dropdownlist object to the window
                   palette._flyout = palette.add( "dropdownlist", [ ( palette.frameSize.width - 20 ), 0, palette.frameSize.width, 20], palette._flyoutMenu.items );
                   // make sure nothing is selected
                   palette._flyout.selection = null;
                   // add the onDraw method that will draw the icon instead of the normal dropdownlist
                   palette._flyout.onDraw = function() {
                        this.graphics.drawImage( ScriptUI.newImage( myFlyoutIcon ), 0, 0 );
                   // add the onChange method to fire off the callback
                   palette._flyout.onChange = function() {
                        this.window._flyoutMenu.callback( this.selection );
                        this.selection = null;
              // execute the draw function to place the flyout in the window
              palette._flyoutMenu.draw( palette );
    // sample usage
         // create the menu items
         var menuItems = [ "One", "Two", "Three", "-", "Four", "Five" ];
         // create the callback function
         sampleCallback = function( selection ) {
              // just letting all the menu items fall through for this demo
              switch( selection.text ) {
                   case "One" :
                   case "Two" :
                   case "Three" :
                   case "Four" :
                   case "Five" : {
                        alert( selection.text );
         // create the palette
         var myPalette = new Window( "palette", "Fly Out Menu Demo" );
         // adding some static text, just because
         myPalette.add( "statictext", undefined, "Demonstration of using ScriptUI drawing to customize control appearance" );
         //center and show the palette
         myPalette.center();
         myPalette.show();
         // add the flyout menu
         addFlyout( myPalette, menuItems, sampleCallback );

  • JS/ScriptUI: placeholder madness

    I created this yummy text box entry placeholder for CS4 on my Mac:
    but for some reason this fails to draw correctly on Windows! If the edit box is active and the cursor is in it, the text is not drawn but the cursor blinks at correct position at the end of that invisible text. Moving the cursor or typing in something makes the text pop back into view. (Sorry, should have thought of making a 'shot of that as well.) A real shame, because on my Mac it works as I meant it to: placeholder text shows when the field is inactive and empty, placeholder disappears when you enter the field and type anything in it. Delete text and leave box makes it appear again.
    Is this an error in my code (silently corrected on the Mac but showing up on 'the other platform'), or is it an error on the Windows' Side of the world? Or is this just something one should not be messing with using ScriptUI? (A fairly reasonable explanation.) Or might it work correctly on CS5 for both platforms? (In which case I could put in a platform/version check -- "no fancy dialog for you, you Older Version on a Microsoft Platform!").
    I also have a variant of same code that would underline static text, which also shows up correctly on Mac and not-at-all on Windows -- but then it may be failing for the very same reason.
    My code:
    var w = new Window ("dialog", "Display Placeholder");
    w.bg = w.graphics.newBrush(w.graphics.BrushType.SOLID_COLOR,[1,1,1]);
    w.textPen = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[0.67,0.67,0.67], 1);
    with(w.add ("group"))
      add ("statictext", undefined, "Text");
      editbox = add ("edittext", undefined, '');
      editbox.characters = 32;
      editbox.onDraw = function(d)
        if( this.text || this.active)
          this.parent.onDraw(d)
        else
          this.graphics.rectPath (0,0,this.size.width,this.size.height);
          this.graphics.fillPath(w.bg);
          this.graphics.drawString("<required>",w.textPen,0,0,this.graphics.font);

    Hi Guys
    Peter, I'm afraid I should disagree with you on a few points.
    (...) In CS5.5, your script breaks on this.parent.onDraw(d). The error message is "this.parent.onDraw is not a function", which is fair enough, because onDraw is a callback. (...)
    The reason why this.parent.onDraw is not a function in Jongware's code, is just that this.parent.onDraw is undefined—as John supposed. When we call x( ) from an undefined x var, the interpreter prompts a not-a-function error.
    Why is this.parent.onDraw undefined? Because there is no line in the code which sets up such member on this.parent—which by the way is a (ScriptUI) Group object, considering the context. What we call 'callback' functions are optional custom methods that are supposed to connect to events, usually, but widget prototypes do not provide any default callbacks. myWidget.onDraw, myWidget.onClick, etc., are simply undefined as long as we don't set them.
    In addition, the onDraw callback, when defined, does not work the same way that other event callbacks (which are high-level fake event listeners and could generally be developed through an addEventListener() setter providing much more precision). Indeed, onDraw has no actual event counterpart (or, if any, it is not exposed to scripters as 'show', 'focus', 'blur', 'change', 'click', etc., are.) As documented, onDraw is automatically called when a widget needs to be (re)drawn, but this 'when' is highly unpredictable as it depends on the user interactions, the OS, and probably a number of low-level events.
    We also know that custom layout—i.e. myContainer.layout.layout(1)—triggers such drawing stages (from containers). Also, there are crazy paths to get a non-container widget redrawn, for example:
        wg.visible=false; wg.visible=true;
    or sometimes:
       wg.size = [wg.size[0],wg.size[1]];
    The issue with manually calling  a custom onDraw() method is we generally don't know when it is safe to call it and whether it may conflict with the automatic calls. I found circumstances where manual onDraw() simply fails due to a temporary invalidation of the widget.graphics property (I believe this depends on the object type). This may explain why Peter wrote:
    (...) onDraw is a function but not one that you call like x.onDraw()
    However, onDraw is indeed a simple (callable) function if the script did it so. What matters is that a custom onDraw() overrides and bypasses, as much as possible, the native drawing stage. So, in many cases, an empty onDraw() callback makes the widget totally undrawn (hidden) although room has been reserved to it during layout. (That's not true for composite or very interactive widgets—such as scrollbar or listbox—which still inherit from low-level painting events, at least partially.)
    ANYWAY, in Jongware's script I don't see any reason to make this.onDraw() attempt to call a hypothetical parent onDraw method—which for the time being does not exist—or even to trigger the native drawing stage on the parent. Why? I guess there is a confusion between drawing and layout (?)
    What is sure is that the statement  this.parent.onDraw(d) fails. And, since ScriptUI is known for hushing errors up in many event handlers, you get unaccountable side effects in your EditText control.
    To me, a valid approach would be to invoke the ScriptUIGraphics.drawOSControl() method when you need to produce the default widget skin before further customization.
    The following snippets should provide better results (unfortunately, I can't test this on all systems):
    // =====================================
    // EditText placeholder
    // =====================================
    var u,
        w = new Window('dialog', "Display Placeholder"),
        e1 = w.add('edittext'),
        e2 = w.add('edittext'),
        b = w.add('button', u, "OK"),
        wgx = w.graphics,
        grayPen = wgx.newPen(wgx.PenType.SOLID_COLOR,[.67,.67,.67], 1);
    e1.characters = e2.characters = 32;
    e1.onDraw = e2.onDraw = function(/*DrawState*/)
        var gx = this.graphics;
        gx.drawOSControl();
        this.text || this.active || gx.drawString("<required>", grayPen, 0, 0);
    w.show();
    And:
    // =====================================
    // Underlined StaticText
    // =====================================
    var u,
        w = new Window('dialog', "Underline Me!"),
        s1 = w.add('statictext', u, "Not Underlined"),
        s2 = w.add('statictext', u, "Underlined"),
        b = w.add('button', u, "OK"),
        wgx = w.graphics,
        linePen = wgx.newPen(wgx.PenType.SOLID_COLOR,[0,0,0], 1);
    s2.preferredSize[1] += 3;
    s2.onDraw = function(/*DrawState*/)
        var gx = this.graphics,
            sz = this.preferredSize,
            y = sz[1]-1;
        gx.drawOSControl();
        gx.newPath();
        gx.moveTo(0, y);
        gx.lineTo(sz[0],y);
        gx.strokePath(linePen);
    w.show();
    Hope that helps.
    @+
    Marc

  • [JS][CS3] Validating edittexts in ScriptUI

    Hi,
    I have to attach validation methods to a bunch of edit fields' onChange. Some fields would have to contain floats (toFixed(2)), some - integers, some - capitalized strings after the field has lost focus. I'm ready with 3 functions to be attached to controls, but I would like to hear the most robust solution to this problem. Would you use ctrl.onChange = fn, or rather ctrl.addEventListener()...?
    Any comments welcome.
    M.

    Wait a second... Something I hadn't considered before.
    The problem of relying on the onChange event of a single field is that a click in an OK button will still close the window.
    But, if you set an event listener to the OK button's click event, you can validate all fields and then cancel the event.
    Here's an example that does work in ESTK2 (CS3) (I think this code will paste and show correctly, if it doesn't, sorry)
    // Basic ScriptUI validation
    /* This script shows the basics of validation using ScriptUI events
    By using the "change" event, a script can be notified that a value has changed. The problem with this approach is that it
    requires a field to lose focus for the event to fire. For example, a user can type an invalid number in a field, then, without leaving
    the field, click the OK button (which is still enabled because validation has not happened on the invalid field yet). In this case, clicking
    the OK button causes the field to lose focus, the validation occurs, but the OK button has already been pressed, and the dialog will
    close with an invalid entry.
    We could use the "changing" event that fires for every character typed; but, that approach brings its own set of complications. For example, the
    user is typing "12 inches" in the field. If the validation routine accepts units and abbreviations, as the user types we get the following states:
    "1" - valid
    "2" - valid
    " " - valid
    "i" - INVALID
    "n" - valid
    "c" - INVALID
    "h" - valid
    "e" - INVALID
    "s" - valid
    That doesn't work.
    If we intercept the OK button's mouseDown event, we can validate all fields, and either allow the OK button click event or cancel it.
    If cancelled, the OK button can disabled, and a visual cue could be provided as to the offending field(s).
    With this approach, the valdiation routines need to have a reference to the OK button, and all registered validations
    must happen each time a field is edited to set the state of the OK button.
    // setControlState sets the background color of a control to "good" or "bad". The white for good, red for bad
    setControlState= function( myControl ) {
    if ( myControl.isValid ) { // we're good, make it white
    myControl.graphics.backgroundColor = myControl.graphics.newBrush( myControl.graphics.BrushType.SOLID_COLOR, [1,1,1,1] );
    } else { // we're bad, make the field background red (straight red, [ 1, 0, 0, 1] is a bit harsh, so we're using a red-ish color
    var myRedColorArray = [ 210/255, 12/255, 82/255, 1];
    myControl.graphics.backgroundColor = myControl.graphics.newBrush( myControl.graphics.BrushType.SOLID_COLOR, myRedColorArray );
    // validateInteger will ensure that a field contains a valid integer
    validateInteger = function( myEvent ) {
    myEvent is passed to the handler when the event fires, myEvent.target is the target control of the event.
    We're adding a property "isValid" to the control so we can quickly check the state of any control
    Note that parseInt parses "12x" as 12, so you can't just check for isNaN on a parseInt...
    // make this a required field by checking to see if there's anything there
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else if ( isNaN( Number( myEvent.target.text ) ) ) { // if it can't be cast to a number, it's obviously bad
    myEvent.target.isValid = false;
    } else {
    // if we can parseIn the content of the field, change it back to a string, and get the original value, the original value must have been a string
    myEvent.target.isValid = ( parseInt( myEvent.target.text ).toString() == myEvent.target.text );
    // set the control's background to red if it's invalid
    setControlState( myEvent.target );
    // check all the fields, and set the OK button state
    validateAll( myEvent.target.window.okButton );
    // validateReal will ensure a field has a valid Real number
    validateReal = function( myEvent ) {
    // make this a required field by checking to see if there's anything there
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else if ( isNaN( Number( myEvent.target.text ) ) ) { // if casting to a number is NaN, it's bad...
    myEvent.target.isValid = false;
    } else {
    // if user enters ".2", parseFloat turns it into "0.2" so the same parseFloat().toString() won't work like it does for integers
    // using a regex instead
    var regex = /\d*\.{0,1}\d*/g; // zero or more digits, possibly a decimal point, followed by zero or more digits
    // if the first element of the array returned from String.match equals the original, we're good
    try {
    myEvent.target.isValid = ( myEvent.target.text == myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) {
    myEvent.targetisValid = false;
    //set the control's background to red if it's invalid
    setControlState( myEvent.target );
    // now check all the fields
    validateAll( myEvent.target.window.okButton );
    // uses the UnitValue object to ensure whatever is typed in will be a valid measurement unit
    // for this handler, we wil set a "fieldUnit" property on the edit box, all units will be converted to those units
    // we're supporting all units that UnitValue supports except pixels and percents as they are based on a base unit and traditional points/picas as no one will likely enter "tpc" or "tpt" vs "pt" or "pc"
    validateUnits = function( myEvent ) {
    // no empty fields
    if ( myEvent.target.text.length == 0 ) {
    myEvent.target.isValid = false;
    } else {
    // this regex will validate the basic form of a unit value - a real number followed by zero or more spaces and possibly a valid unit string
    var regex = /\d*\.{0,1}\d* *(?:in|inch|inches|ft|foot|feet|yd|yard|yards|mi|mile|miles|mm|millimeter|millimeters|cm| centimeter|centimeters|m|meter|meters|km|kilometer|kilometers|pt|point|points|pc|pica|pica s|ci|cicero|ciceros)?/gi;
    var myMatch = myEvent.target.text.match( regex );
    try {
    myEvent.target.isValid = ( myEvent.target.text == myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) {
    myEvent.target.isValid = false;
    if ( myEvent.target.isValid ) {
    // create a new UnitValue from the target text
    // it's posible that the units were left off, in which case the fieldUnits are assumed.
    // so use the regex from validateReal to see if there's a unit attached to the value
    var regex = /\d*\.{0,1}\d*/g; // zero or more digits, possibly a decimal point, followed by zero or more digits
    // if the first element of the array returned from String.match equals the original, there's no units
    try {
    var hasUnits = ( myEvent.target.text != myEvent.target.text.match( regex )[ 0 ] );
    } catch( e ) { // if this errors, something is very, very wrong...
    myEvent.target.isValid = false;
    setControlState( myEvent.target );
    validateAll( myEvent.target.window.okButton );
    return;
    if ( !hasUnits ) {
    var myUnitValue = new UnitValue( myEvent.target.text + " " + myEvent.target.fieldUnit );
    } else {
    var myUnitValue = new UnitValue( myEvent.target.text );
    if ( isNaN( myUnitValue ) ) {
    myUnitValue = new UnitValue( "0 " + myEvent.target.fieldUnit );
    try {
    // attempt to convert it to the fieldUnit - if it can't be done, this will error
    myUnitValue.convert( myEvent.target.fieldUnit );
    // the reason for the convert is that the UnitValue.toString() will inclue the abbreviated units for us, using UnitValue.as() will not
    myEvent.target.text = myUnitValue.toString();
    } catch ( e ) {
    // if we errored, it wasn't a valid measurement
    myEvent.target.isValid = false;
    setControlState( myEvent.target );
    validateAll( myEvent.target.window.okButton );
    // validateAll - this function is hard wired to check the isValid state (set in the validation routines) of the edit boxes used in the test example
    validateAll = function

  • [JS][CSX] ScriptUI Tip

    Hi
    I thought it was about time I contributed back on here, and share a quick tip I stumbled accross.
    I have attached a screen shot of a dialog to select different scripts from, but you may notice the top text looks bold.
    To make the text appear bold, simply repeat the line of code:
    myText = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for');
    myText2 = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for');
    Anyway, just thought I'd share that with you.
    Roy

    Here is some Rapid ScriptUI code
    var rapidDlg = new Window('dialog',"Bold",undefined);
    buildWindow();
    rapidDlg.show();
    function buildWindow(){
    // Properties for rapidDlg.StaticText1
         rapidDlg.StaticText1 = rapidDlg.add('statictext',undefined,"Lets Be Bold");
    rapidDlg.StaticText1.graphics.font = ScriptUI.newFont(rapidDlg.StaticText1.graphics.font.family,"BOLD",rapidDlg.StaticText1.graphics.font.size);
    // Properties for rapidDlg.Panel1
         rapidDlg.Panel1 = rapidDlg.add('panel',undefined,"I'm Bold on a mac");
    rapidDlg.Panel1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.graphics.font.family,"BOLD",rapidDlg.Panel1.graphics.font.size);
    // Properties for rapidDlg.Panel1.Button1
         rapidDlg.Panel1.Button1 = rapidDlg.Panel1.add('button',undefined,"Hey Bold fellow");
    rapidDlg.Panel1.Button1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.Button1.graphics.font.family,"BOLD",rapidDlg.Panel1.Button1.graphics.font.size);
    This is what it looks like on Windows XP SP3 using CS4 & CS5
    if I remember correctly it does show correctly on the mac

  • JS ScriptUI CS4: How to create an indeterminate progress bar?

    Hi Folks,
    Does anyone here know if ExtendScript (I'm using the CS4 flavor of ES) can produce an indeterminate (i.e., "barber pole") progress bar using ScriptUI's progressbar control? I've tried a number of value settings for the progress bar control in hopes that they would trigger the barber pole behavior, but so far, no luck.
    My current workaround is to "loop" the progress indicator. In other words, when the progress bar's value > maxvalue, I reset the value back to minvalue. Then rinse and repeat. Not really what I want, but the task being processed takes quite a bit of time, so I need to show some sign of something happening to the user.
    Thanks!
    -- Jim

    Hi Jim and Jeff,
    I can't find any practical solution to the original problem. It seems that an ExtendScript function call and a ScriptUI window cannot properly update synchroneously, except with a regular progressbar widget. I thought that a nonmodal window (='palette') might be fine, but I always get critical side effects using that approach, and generally the SWF is 'freezed' during the process. Curiously I found a kind of workaround using a pure modal dialog which mimics a nonmodal palette (!!) through the 'activate' event. But this still requires that the outer function perdiodically calls the update() method of the window from its own body, so this does not answer the question.
    Here is a first draft, based on the SWF that Jeff posted above and only tested on a Win platform. I'd really appreciate feedbacks on this from Mac users.
    // SpinProgressBar Object
    // Tested in ID CS4/CS5+ Windows only
    var SpinProgressBar = SpinProgressBar||function SB(/*str*/msg, /*fct*/process)
        // Caches the function resources
        SB.rc = SB.rc||{
            swf: "CWS\tP&\x00\x00x\x9C\x8D\x9A\x7FL\x15W\x16\xC7\xCF\x11\xC5\x11)\xE2oQ\xD0'\x0F}O\x14\x7F\xA0\xE2o|\xCA\x11\x04\x05\x04\x14\x14Q\x11\xF1'\x82\n\" \xA2(j-\xB6(Hmw[\xDB&m\xD3\xCDnKbRLI\x7F\xC4&\xEBn\xDCdmk\xB3j\xAD\x9Bvwm\xC4\xAD1\xDB\x8D\xA9Y\x93\x8D\xFB\xBD#2\xE3\xF0\xB6\xEF\xF2\xC7H\x8Egf\xEE\xB9\xF3\xFD\xDC\xF3\x9D;TS\x9F\b\xA2!\xC5D\xA1\xA1$\x03\t?I\xBD\x1E?~\x1Cc0UV4\xC6\xE7\xCD~\xDB\xC5\xD4\xD9\xD9\xF9\x98\xC2\x07\xF5o-\xCE:s\xB5\xE3\x8F\x1FT\x9CZ\x121\xFA\xB7\xF1t\xAB_/bj\t\x0Ec\xFCs\x99\xC8G\xBDh;\xF9\xC2{\xE37\"\xB7\x11D\xDB\xA8\xEF\x97\xD4\xA7\r\xFF\x8D\x1F\\#\xA4\x7F\xCA\x97\xEDWnf\x97/j\xFAK[yb=\xB9\x8C\xDE=\x93\x8C\x86\xF6\x92\xD7O\xBD}\xA1\xF5\xF5\xD3\x85\xE45\xFA c\x90\x8B\xFA\xFC`\xBB\x8C\x8F\xCE\x95\x95\x9ExT\x15W\xD9\xD8q\xF9^\xC4wi\xA9\xD7\x90\x19\xFC4\xB3\xDE\xCA\xCCv\x8D\xC9(\xAF\r\xAE\xBA\xDAR\xD9q\xC1\xFD\xE3\xAD\xF6k\x13\x90\xD9\x17\x99\xC3\xCFR\xEF\x13\xB6k\x12\x97t\xBC\x99|\xE9\xAFs\x1Fe\xDF9r\xFBa\xED\xD0a\x1F!\xD3\xF0\x93\x99w6aru|f\xD5\xF9\xD4\xEE3(\xDA\xE8\x87L\x9C\xC2\x0F\xAC\xCC\x90\x8BA\x9D\xF7\xF2\xEFL\x1Aq\xEF]\xCF\xC4NLIH\xCF\x9C\xFE\xB9\x1FQ\xD8\x9F\xB2\xCB?k\xBA\xD4V\xFEy=n\xD9\xDF\xCF-s\xDA\x9A\xC3\xB6^\xC5-3Z;\xBE\xFF\x03n\xF9C\x1By\x8CP\x95\xD9\xFALf\xC8\x9B\xBE\xA07Bw\xAE\xFB\xFA\xFD\xFC\xFB\xE6\t\xB9\xAD\xF5^\xE3\xB9\x9Es\x18\xF2m8\xDD\xF1\x9Cz\xAF\xFC\xBAg\xEDkE\x9F\x9F{\xF0n\xD1[\xB8y\x98\x9F9\\V\xF0\xC9g\xA5'1\x87/7\xD6\\\u00FE\xC7\xDD[\xED\x97\xAF\xD3;\xC1\x93{\xE1y\x9B\x8F=,\xAB9\xD9\xF7\xE4\xC9\xAF*+\xDBX\xBA\xB9\xD8\x95SSZ\xB4k'\x9D\x0E\x0E\x0B\xA2 \x8A<S?\xAAP%\x04\xA9Ho\xEA\x8DHC\x8B)\x16V\x91>\xD4\x87\"Sj3\xDF\xEA\x8E\x04S0E^X\x9A\xF9}w\xA4/\xF5\xA5\xC8\xC1\x8F\xBEquG\f2(\xF2\xEB\xBBQ\x17\xBB#\xFD\xA8\x1FE\xDE>\x92a]9\x84B(2\xF8\xEF]\x91\xA3\x88\xF4\xA7\xFE8\xEB\x9F\xB6\xEB\x84R(\x8D\xF4<\xA82sz\xA9\xC8s\xF4\x1C\x8Dl\xFA\xDB\xC2z3\xA2\xCE\n\xA30\x8Cg\xD9\xD3\x11\n+\xCD\xFB0_\x03\xFC\xA83\xF9\xF7\x9F\xB4\xFD\xD0v>o\xCE\x82\x86ywS\xE7\xDE\xFAv\xE0\x03d\x86\xFB\xC9\x84\x16\x9Ef\xDC\xCF\xFFqh\xC5\x99\x1BS\x919\xB0\xE7c\xB5\xD4y3\xFBNC\xCCSu\x0E\xF2\x93\x99\xD7\xDA\xA5\xCE\xAC\xEE3\xC0\xD9\xE0\x9E\xCA3\x1A^~\xB0/\xAE\xE2l\xE8\xBE\xEC\xD3\xD0\xE6\x10\xBF\xDALlZ=\xED\x9B\xB4\x8C\xBC\xAFn\xB4_\xC4\r\x87\xFAQ\xDC\xC5\xA0\xA2\xFB\xE7\x8A\xAEW$\xB6\xD4~\xDA\xF8\xE1\xBB_\x04'\xB8\x909\xCC\xEF\xD0\xF2\xEF\xFF\x1C{\xF5\x95\xF9#n|\xFC\xDE\xEA\xF6[_\xBC\xF3\x062\x87\xFB\x99\x18H\xAE\xADKr\x1DO$\xA7\x00\x1F\xA1)\xE3h#\xA2\xE7\xB2\x12\xF2\x9D\x8Fn7D\xFD\xAE\xE0v]\xD4\x87\xEF\xA0\xE0\x91~\xD6'\x1F\xB5_I\xF9\xEA\xDB\xB4\x8C\xA5\xD3n\xA2`\xA8|\x80\x96\xCA\xC3i\x80\xA5WS\xE5\x03)\xDC\xA1\xE9A4\xD0T\xB0\xA5\xCE\xC14\bZ\xFC\xC9\xA6\xE0!4\xD8\xA6W\x15\x19JC\xA0\xE9\xFD\xB6\xC80\x1A\xEAP\xF0p\x1Af)\xD8T\xF9\b\x1A\x8E\xF1$\xD9\xEE\x1EA#l\x9AV\x91\x91\x14\x01\x0E\xAB\x9F\x90i\xAA|\x14\x8DD\xA4\xB6\xF9\xFB\xA7*W\x88\x0B+\x84\x85\x15\xB6\xC2\nUa\x85\xA7\xB0BRXa(\xAC\xD0\x13V\xB8\t+\xC4\x84\x15V\xC2\n%a\x85\x8F\xA2e\x94\x1FQ$u6\x87\xDD\xBD\x06QDx>\xBE\xF1\x1B\x88\xE2\xED\"dF\xFA\xC9\xCCy\x9F\xC2~\x8E\x8D\xAB\x9A\xDE\t\xF9\xACM+\xF8W\xF1\x1BPvT@e\x8F\x0E\xACl\x8F1\xE6\x17\xD6\xD26\xAC\xA5W\x9E\xAE\xA5.\xBF#\xEBZ\x9Es\xBB\x96\xE7Kjy\x1E\xEBG\xAE\xF5}\xBF\xEE(9\xF3\xC1\x9F\xCF\x17^y\x94\x8D%b~\x1D\x8A\x8D\xF6C@\xB6\xEB\\YW\xC6\xBC\xB3\x1DX\"\x86\x85\xA2\x14w`\xCDF\x1B1\x01\xC5\xEF5\xC6\xF9\xBDew\xAF\xFC\xCF\x05\xF7\x1D\xF4\xCAXd\x8E\xD7\xEC\xBF`%R\x8B\x95(\x1Ae\xAD\xDB&+\xA3)\xD2\xB1\xB6\x8F\xA1(\x07\x07.\x1A\xED\xE0`,\x8D\xB1\xA9^E\xA2\xC9e\x92aE\xDC4\xD6\xBEn#\x12C\xD1\x16\x07&+\xE3\xC8mW=\"\xE3)\xC6$\xC3b\xC5C\xE3p\x1D\xDF\x13\xBEMV\xBC4\x1E|WX\x1D\xA1\x17\x96\x00\xE1\x01\xC0^8\x1C\xA8\x0B\x0F\x04\xDE\xC2\x83\x80\xB4\xF0``,<\x04\xE8\n\x0F\x05\xAE\xC2\xC3\x80\xA8\xF0p`)<\x02(\nG\x00?\xE1\x91\x98\x1E\x1F\x9E\xA2G\xC3Ox\x03\xFB\t\x8F1A\xD7%\xC4j\x1A\x0F\xAF1\xB1\xA7K\xB0-\xC4\x1B\xB0\x10\xD7u\xF9\x89I\x9A~\xC2e\xC4\x05p\x82ncr`C\xE95\xA6\xF8\xB9!\xE4z\xB0K\xAE5O\xE4z\x1D\x99S\x7F\x19\x01\xD8\xC5\xBB]\bL\xD34\x81^#^\xD3X\x02\x96\tZ\xB0\xC4\x92\xC7\xB24&,\x13\xC9\xEB@c\x12Mp\x80\x10G\xB1\x8E\x161\x99&\xDAd\xAF\"Sh\x92\x03\x8D\xA9\x14\xA7@\xB0\x19\xB3i4\xD9\x02\xC1\x84%\x9E\xA6\xD8e\x8F\xC8t\x9Aj\xB5>\x13\x96\x194\xCD\x02\xDC\x84e&\xC5\xDB\x01W\xB0D\xE28\n\x94\x0BG\x82l\xE1(\xD0,<\x1A\x04\x0B\x8F\x01\xB5\xC2.\x90*<\x16t\nG\x83Ha7(\x14\x8E\x01y\xC2\xE301\xC2\xE31\x19\xAA\xB1L\xD7\xF6%3\xB4}\xC9Lm\xD3\x9C\xA0\xE9`\xA2\x8DY\x1A\xBEdv\xE05\xDEk\xCC\xD1v\x93s\xB5\x1D\xEA\xBC@\xBE\xB3\xF8a\xED\x90\xB3\xCAw\xCE\xD7\xF4\x9DncA\xE0\xDE\xEB2\x12\x03\xB4p\xD0\x92\xA0E\xCB,\x9An\xE9\xDE\xA4e6\xCDp\xB01\x87f:H\x98K\t\x0E\xB34\x8Ff\xD9t\xAF\"\xF3i\xB6\xA3I,\xA09\x0E\x12\x12i\xAE\xED\xA5E\xE9~!\xCDsX>\x1F\xCD\xB7\xB1\xA1\"\x8Bh\x81jl\xE9VkYL\x89 \xFCf\xBA\xCD\x86M\xC0\xD1\x03\xA8\x85\xBD\x00Yx\x02\xE0\x15\x8E\x05\xB0\xC2\x13\x01\xA9\xF0$\x80)\x1C\x07\x18\x85'\x03@\xE1)\x80Nx*\xA6Dx\x1A\xA6A8\x1E\xA5\xFB\xD0\x11\x16\xEA\x1A\x13\x9F\xA61\x896\x16i\b{\xB1\x8E\xB0\x93\xB4We\xD1\xDE\x18X\xA2i&\xBDF\xB2\xA6Au\x19)\x01m\xE7R\x9D\x17\xAATm7\x99\xA6gP\xC1J\x92\x16+B\x0B\xAD\xF5\xDFde\tNy\x96\x8CdZd\xBD\"\x98\x91\x14Z\xEC\xE0`)%Y\xD6\xC8\x8C\xA4\x928\xC8H\xA3%\x0E\x83\xB7\x8C\x92m/\xEFJ\xF5\xCB)\xC5\xAEzD\xD2i\xA9\x8D\f\x15\xC9\xA0T\x9C\xF5\xEF'<\x99\xACdR\x9A\x9Do\xC5J\x02\x8E\xD3\x01\xB0\xF0\f@+<\x13\xA0\n'\x00N\xE1Y\x00Rx6 \x14\x9E\x03\xF0\x84\xE7\x026\xE1y\x98\f\xE1\xF9\x98\x00\xE1\x05(Z8\x11\x85\xFA\xF0\x9C\x97\x05\xB4%\xCBulI\xBA\xF6\xDET\x86\xB6\x81\xC9\xD4\xB6%+4m\x89\xDB\xC8\n\xEC(\xA3\x8D\xEC\x80\xD6\xD4c\xE4\xF4\xBC\xE53\xAE\xF3\x9A\xE9)\xE1:Wj\x12\xE05V\xFD\xFF6\xFB\xD0\xF2\x92\n\xF8\\M\x7F\nXVh\xC1\x92E\xCB,kd\xC2\x92M\xCB\x1D-\"\x87\xD2\x1D{V+)\xC3\x01\xC2*\xCAt\xECY\xE5\xD2\n\x07\x1Ay\x94\xE5\x00a5e+\x13\x98n5\x965\x94\xE3hk\xF9\xB4\xD2j}&,ki\x95\x05\xB8\tK\x01\xE5\xDA\x01W\xB0$\xE1\b\xE9\xE3\xE8\x03\xA3\xC2\x8B\xC0\xA5\xF0b\xB0(\x9C\x04\xFE\x84\x05\xCC\t/\x01g\xC2\xC9\x98\x06\xE1\x14\x94.\xBC\x14\xE5\n\xA7\xA2D\xE14\x94\xA5lX\x9E\xB6+Y\xAD\xEDJ\xD6hz\r\xAF\x91\xAF\xE9_\xDC\xC6Z\x1DWR\x10`\x85\xF7\x1A\xEB\xB4\xBD\xE4zm\x7F\xBA!\xA0\xEB\xFC\x14\xD2Uw/\xD4t\x9Dnc\xA3\xCE\xAEAQ\xC0\x0E\x0EZ\xD6i\xD1\xB2\x9E\xF2,\xDD\x9B\xB4l\xA0\xD5\x0E6\ni\x8D\x83\x84\x8D\x94\xEF0KE\xB4\xD6j\x00fd\x13\x158\xD8(\xA6u\x0E\x126\xD3z\xDB\xCB\x8F\xD2\xFD\x16\xDA\x00\xDD\xFFdkl[\xA9\xD0\xB2|&-\xDBh\xA3\xDA\x95n\xB6l\xD8v*\xB27?E\xCB\n\x1C\x97\x01O\xE1\xE5@R8\x1D\x18\ng\x00=\xE1L\xE0&\xBC\x02\x88\tga\x02\x84\xB3Q\xB4p\x0E\n\x15^\x89\xE2\x84W\xA1 \xE1\\\x14\xA1h\xD9\xA4mK\x8A5m\x89\xDB\xD8\xAC\xA3\xEC-\x01\x95\xBDU\xDB\x96l\xD3\xDD7\xDB\xAE\xE9%=\xC6\x0E={\x1Am\x94h\x98\xCE\x9D:\xA6\xB3T\xDBJ\x96i\xEE\x9B\x81\x95\x1DZ\xAC\x94\xD0&k\xFD7Y\xD9I\xC5\x0E2Ji\xB3\x83\x832\xDA\xE2\xE0`\x17m\xB5\xAC\x91\x19\xD9\x8D\xA1>K\xC6\x1E\xFC\xFA\xAC\xC1+\xA7\x1D\xB6M\x00\xA5\xFA\n*\xB1\xBE\xD7\x989{i\xA7\x8D\f\x15\xA9\xA4R\x93o\xEB\x05\x7F\x1F\x95\xD9M\xA0be\x1D\x8Ey@Qx5\xF0\x13^\x03\xE4\x84\xF3\x81\x99\xF0Z\xA0%\\\u0080\xD2\x85\xD7\xA1\\\u00E1\xF5(Qx\x03\xCA\x12.D)\xC2j\xD1\x12.R\xA3\xC7c\xDC\xA5\xE3Kv\x07\xF4%^c\x8F\xBFM.\xA5\xECk\xB6M.S\xD9\xE5\xBA\x0E\xA6B\xFB\x03\xC6^M_\xE26*u>\x9E\xEE\x0B\xF8\xF1\xB4J\xDBvVk#P\xA3\xFDyj\xBF\xA6A\x05,UZ\xB0T\xD3.K\xF6&,5\xB4\xDBf\x8DTd?\xEDq\xEC}\xD5R\xB9\x03\x84\x03T\xE1\xD8\xFB\xAA\xA3\xBD\x0E4\x0ER\xA5\xE3\xDD\xE7\x10\xED\xB3}\xB8T\xB2\xAF\xA7*G[;L\xD5V\xEB3a9B5\x16\xE0&,\r\xB4\xDF\x0E\xB8\x82e\x07\x8E\x9B@\x9Ep1h\x13\xDE\f\xC2\x84\xB7\x80*\xE1\xAD(Zx\x1B\n\x15\xDE\x8E\xE2\x84w\xA0 \xE1\x12\x14!\xBC\x13\x03\x17.\xC5`\x85\xCB0@\xD5Xj\xB5}\xC9\x01m_R\xA7-\xF2\x83\x9A\xFBfn\xE3\x90\x8E/\xA9\xD7\xF8\x9AqX\xDBM\x1E\xD1v\xA8\r\xDA\xBE\xF3\xA8\xA6\xEFt\x19\xC7\x02n\x1A\x1C\x0F\xDC\xBFA\xCBQ-Z\x8EQ\xAD\xA5{\x93\x96\xE3t\xC0\xC1\xC6\xF3T\xE7\xD8\xFB:A\x07\x1D$\xBC@\x87\xAC\x06`F\x1A\xA9\xDE\xD1$N\xD2a\x07\t/\xD2\x11\xABI\x98\xB4\xBCD\r\xA6\xEE\xAD\x9C&:jY>\x93\x96StL\x11\x9Ea\xBD\xE1\x9F\xA6\xE3\xF6\x0F?\x8A\x96*\x1Cw\x014\xE1\xDD\x80Kx\x0F\x80\x12.G\xB9\xC2\x15(Qx/\xCA\x12\xAED)\xC2\xFB0|\xE1*\fY\xB8\x1A\xC3\x14\xAE\xC1\xD0\x84\xF7c8\x8A\x96\xE7\xB5\x8D\xC9\t=c\xE26^\xD0\x11v\xA3\x86\xB0Oj\xAF\xCA/j\x7F\xD0{I\xFB#l\x93\xA6A\x8D1N\xFD\x82l\xD7\x1F\xFA/\x14\xBE\x1B\xF2?\x1D@\xFE\x1E\xA3Y\xD7M\xB6h\x1AT\xC0\xD2\xAC\x05K\x0B=o\xC9\xDE\x84\xE5\f\x9Dp4\x89Vz\xC1\x01\xC2\xCB\xD4\xE8\x00\xE1,\x9D\xB4\xC9^E^\xA1\x17\x1D\x1Bd\xAF\xD2K\x0E\x87\xF7+j\xB2\xED\x02(\xD9\xFF\x9AN9\xBEw\xBEF\xA7mh\xA8\xC8\xEB\xD4l\xFB\xCB\x15u\xD69j\xB1\x7F\x01U\xB0\x1C\xC5\xB1\x16T\t\x1F\x00I\xC2u(T\xF8 \x8A\x13>\x84\x82\x84\xEBQ\x84\xF0a\f\\\u00F8\b\x06+\xDC\x80\x01\n\x1F\xC5\xA0\x84\x8Fa \xC2\xC7qs\x1F\r\x0EcL\xA6c\xF2\x88\xFE\x07WG@D",
            bkg: [232,232,232],
            tmpFile: function FN(/*?str*/s)
                    FN.file && FN.file.remove();
                    FN.file = null;
                    if( !s ) return null;
                    return FN.file = (function(fx)
                        fx = new File(''+fx);
                        if( !fx.open("w") ) return null;
                        fx.encoding = 'BINARY';
                        fx.write(s);
                        fx.close();
                        return fx;
                    })(Folder.temp+'/_'+(+new Date)+'.swf');
        // Creates the UI
        var    rc = SB.rc,
            w = new Window( 'dialog', '', undefined, {borderless:true} ),
            p = w.add( 'panel' ),
            fl = p.add( 'flashplayer', undefined, rc.tmpFile(rc.swf) ),
            t = p.add( 'statictext', undefined, msg),
            r;
        rc.tmpFile(); // kills the tmp swf file
        // UI Skin/Style
        with( w.graphics )
            backgroundColor = newBrush(
                BrushType.SOLID_COLOR,
                [rc.bkg[0]/255, rc.bkg[1]/255, rc.bkg[2]/255, 1 ]
        p.orientation ='row';
        p.alignChildren = ['left','center'];
        fl.preferredSize = [50,50];
        // Fire!
        SB.win = w;
        w.onActivate = function(){ process(); w.close(-1); };
        r = -1==w.show();
        // Cleanup and return
        SB.win = null;
        w.onActivate = null;
        rc = w = p = fl = t = null;
        return r; // true=>OK, false=>broken
    // SAMPLE CODE
    var myHugeLoop = function()
        var i = 500000;
        while( i-- )
            // you have to periodically call SpinProgressBar.win.update()
            // but not necessary at each iteration
            SpinProgressBar.win.update();
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i)*
            Math.cos(i);
    if( SpinProgressBar("Currently processing a huge loop...", myHugeLoop) )
        alert( "All is fine." );
    else
        alert( "The process has been broken by the user!" );
    @+
    Marc

  • [JS][CS5] ScriptUI

    I was just wondering if it was possible to link a web graphic to a ScriptUI window using something like this:
    myImage = myDialog.add('image',undefined,'http://dl.dropbox.com/u/1942401/tabs.gif');
    Just wondered....
    The above example didn't work by the way, and the link is a public link.
    Roy

    Roy Marshall wrote:
    How do I process the string from an existing icon, and the the correct syntax for reading it back in?  Can you help with this?
    Here is the basic idea:
    function serializeFile(/*str*/path)
         var f = new File(path),
              s = null;
         if( f && (f.encoding='BINARY') && f.open('r') )
              s = f.read();
              f.close();
         return s && s.toSource();
    alert( serializeFile("/path/to/my/file.png") );
    @+
    Marc

  • (CC 2014) ScriptUI font do not change?

    I have tried to change my ScriptUI font, but nothing changed. I have also tested out with Peter Kahrel's guide where he is showing how to use fonts in ScriptUI, but none affect
    Like:
    var w = new Window ("dialog");
    button1 = w.add ("button", undefined, "Default");
    button2 = w.add ("button", undefined, "Bigger");
    button2.graphics.font = "dialog:18";
    w.show ();
    or
    function createMessageWindow ()
    var w = Window.find ("palette", "Message");
    if (w == null)
    w = new Window ("palette", "Message");
    w.mess = w.add ("statictext", [0,0,300,20], "");
    w.show();
    Is there some problems with CC 2014 with this atm. I tried to find answer here, but none. Someone?

    Ah this is sad. But I guess this is part of their plan to make us to use Extension Builder Or something. Don't know...
    Thanks for the answer anyway Silly-V!

  • Documentation of ScriptUI window.update()?

    Does anyone know if this function is documented? I'm trying to implement a progress bar similar to the one Marc Autret supplies here: Re: Type of window for progress bars?
    In general it is awesome and works well. The one problem I have is that I want to be able to change a statictext label as the progress bar moves along. When I do this, the statictext loses its centered justification. The only thing I've found that is even close to helpful is that when I apply the mysterious .update() function, the label will rejustify itself -- but only for a second. I thought if I could read about the nuts and bolts of what this does, I might be able to work out a solution.
    It's a minor aesthetic thing, but I would really like to understand it.
    My hit function, where the problem occurs:
    this.hit = function(msg) {
         st.text = msg || st.text;
         w.update();\\Causes the window to flicker; you can tell that the text is justifying to center and then moving back to the left.
         ++pb.value;

    Hi cchimi,
    Regarding Window.update() here are some details:
    [ScriptUI]  Window.update()
    Allows a script to run a long operation (such as copying a large file) and update UI elements to show the status of the operation. Normally, drawing updates to UI elements occur during idle periods, when the application is not doing anything and the OS event queue is being processed, but during a long scripted operation, the normal event loop is not running. Use this method to perform the necessary synchronous drawing updates, and also process certain mouse and keyboard events in order to allow a user to cancel the current operation (by clicking a Cancel button, for instance).
    During the update() operation, the application is put into a modal state, so that it does not handle any events that would activate a different window, or give focus to a control outside the window being updated. The modal state allows drawing events for controls in other windows to occur (as is the case during a modal show() operation), so that the script does not prevent the update of other parts of the application's UI while in the operation loop.
    Anyway I strongly doubt you reach any satisfactory enhancement using either w.update() and/or w.layout.layout(…)—on the AutoLayout manager algo, my investigations here: http://indiscripts.com/blog/public/LayoutManager-Draft.pdf
    But here is the promising fact: reassigning StaticText.location is much faster than any other approach. So one can manually center the message—keeping the statictext left-justified—by simply repositioning the control with respect to the width of the text. That can be done on the fly using StaticText.graphics.measureString(newText). Give a look at the new implementation of my ProgressBar snippet to see how it works:
    Re: Re: Type of window for progress bars?
    My tests provide good results (so far) on various ID versions from CS4 to CC.
    @+
    Marc

Maybe you are looking for

  • "Hide" External Drive for Time Machine use only

    Hi everyone, I have an AirPort Extreme with 2 External Drives connected to it on wi-fi. One with 500GB I use for "File Server", so all computer in my network can store files on it. The other one, with 1T I use as Time Machine backup ONLY (over wi-fi)

  • Hotmail will not open messages in FF 3 or 5 or 6 since Aug 2011 - Hotmail works in IE

    Hotmail will open to the inbox page but none of the folder links or message links will work. No error messages, just no action. like all the links are disabled. The top menu items are active and work if pressed, just not the folders or messages

  • Placing a Logo GIF above the MenuBar in a JFrame

    Hi.. I am trying to place a logo image (GIF) in the main frame (JFrame) of my application. I wish to have this image placed above the Menubar and below the Titlebar. I have set the Menubar using the setJMenuBar() method of JFrame. I have no idea how

  • Trouble shooting XI interfaces

    What are the different methods of trouble shooting XI Interfaces. Regards, -Naveen.

  • Encoding In Oracle

    Hi, We are using Oralce Obfuscation Kit to encrypt some of the information like password and Card Number. We need to encode the binary data and store it as a String in the DB.(One type of encoding is a Base 64 Encoding) I got a sample program from Or