ScriptUI executing: ETSK vs Illustrator


hey everyone, having technical difficulty unsettling me:  appears ui functions execute differently in etsk illustrator, intended app. 

 

this code find item in list , target it, if list long, wanted find button disabled while searching.  wanted have "nothing found" pop momentarily before clearing find field.  in etsk works supposed to, in ai search functions , clears field, not disable find button or little pop-in message of "nothing found".

 

by way.. putting alert() function in parts not seem executing, makes execution visible held alert box? 

 

[edit]: interestingly, works fine in indesign not in photoshop- displays worst actually.  i'm on cs5 btw.

 

have advice? 

 

thanks in advance who's wanting take @ this.

-v

 

var w = new window("dialog","find list");

var l = w.add("listbox"); l.size=[170,400];

for(i=0; i<1300; i++){

    l.add("item","line "+i);

}

 

var findwindow = w.add("edittext"); findwindow.characters=25;       

 

var findbtn = w.add("button",undefined,"the find button");

findbtn.onclick = function(){

    if(findwindow.text != ""){

        findbtn.enabled=false;

        var searchrx = new regexp(findwindow.text,"ig");

        for(i=0; i<l.items.length; i++){

            if(l.items[i].tostring().match(searchrx)){

                findwindow.text = l.items[i];

                l.selection = i;

                break;

            } else if(i==l.items.length-1){

                findwindow.text = "nothing found"; $.sleep(700); findwindow.text = "";

            }

        }

    findbtn.enabled=true;

    } else {

        findbtn.enabled=true;

        alert("type find window");

    }

}

 

w.show();

add couple of window updates follows

 

here

         findbtn.enabled=false;                     w.update();         var searchrx = new regexp(findwindow.text,"ig");  

 

and here

            } else if(i==l.items.length-1){                 findwindow.text = "nothing found";w.update(); $.sleep(700); findwindow.text = "";              } 


More discussions in Illustrator Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support