12 December 2003, 04:58 PM
hmm, you announced "global string $sel and $newName" three times. You only really need it once... and Id use hesitation using the global part.
When you write "textField -editable true -text $newName ;", -text changes the default text written in the box, not a query of the box. Id suggest querying the box (seen below) when you need the value, because it may change between the time you open the window and when you need it.
I also suggest you pass variables to the procedure as you need them, to make sure you know what the content of the veriable is at that time.
one note, you can use "print $var" as a test at any time to find out what the variable's value currently is.
Here's my version:
string $sel=`ls -sl`;
textField -editable true renameText;
button -c "doit($sel)" button;
proc doit(string $sel)
rename $sel `textField -q -tx renameText`;
12 December 2003, 08:31 AM
hmmmm.. now I understand :bounce:
this is funny
thanks for your help
01 January 2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.