Pause An Continue A Script

Hi

i have a script, which runs through and at a certain position i need an input given from textscrolllists (you have to choose from a list of options). this is in the middle of the script and that's the problem. at this position the script must stop and wait for the selection of the user. when the ok button is pressed, then the script should continue.

may someone of you can help me

thanks for reading ... greets ...
malacay

Hi,

The layoutDialog mel command allows you to show a modal UI and wait for user input.

Cheers,

Ian.

Hi

You can use confirmDialog for this or u cn ask prompt dialog or if you working in maya 7 u can use

LayoutDialog

http://localhost:4449/Maya7.0/en\_US/Comman...youtDialog.html

isit ??\

regds

o.S.k

hi

the layoutDialog would be the best for me, but i sadly have to work with maya 6.01.
the prompt- of confirmDialog are not exactly what i need, because the user must choose from a given list and i don't get such one with the promptDialog.

but thx for help

Is this you want do inside of a for loop ???

Can you split your script into two halves? The first half runs and then launches the dialog box with your textscroll list, you then run the second half as the callback on your ok button.

I

yes ... it is a loop.

QUOTE(malacay @ 04/12/06, 02:31 PM) [snapback]234042[/snapback]
yes ... it is a loop.

Hi

I dont know is it good way just check it

CODE
global string $getherefind="";
global string $getWhtFiound="";
global proc callherefortest()
{
    global string $getherefind;
    global string $getWhtFiound;
    string $getTotalSelected[]=ls -sl;
    for ($getTotalSelected_new in $getTotalSelected)
    {
        if ($getTotalSelected_new=="w5")
        {
            if ($getherefind=="Found")
            {
                print ("This We Found : "+$getWhtFiound+"\n");
                print "Found..Exiting\n";
                $getWhtFiound="";
                $getherefind="";
            }
            else
            {
                callnextprochere;
            }
        }
        else
        {
            print ($getTotalSelected_new+" found \n");
        }
    }
}
global proc callnextprochere()
{
    if (window -exists mytestwin)
    {
        deleteUI -window mytestwin;
    }
    window -title "TEstWin" -wh 150 200 mytestwin;
    columnLayout -adj true;
     textScrollList -numberOfRows 8 -allowMultiSelection true
         -append "one"      -append "two"      -append "three"
         -append "four"     -append "five"     -append "six"
         -append "seven"    -append "eight"    -append "nine"
         -append "ten"      -append "eleven"   -append "twelve"
         -append "thirteen" -append "fourteen" -append "fifteen"
         -selectItem "six"
         -showIndexedItem 4 testScrolllist;
    button -l "Find What Selected" -c findwhtsel;    
    window -e -wh 250 160 mytestwin;
     showWindow;
}
global proc findwhtsel()
{
    global string $getherefind;
    global string $getWhtFiound;
    string $findhere[]=textScrollList -q -si testScrolllist;
    $getWhtFiound=$findhere[0];
    print $findhere;
    $getherefind="Found";
    deleteUI -window mytestwin;
    callherefortest;
}
callherefortest;

hi

thanks for your script example kurianos ... it helped me very much!