PDA

View Full Version : sending a string variable from a button


mrp86
02-17-2011, 12:57 PM
This can't be a difficult task, How do you send a string variable from a button?

i.e.


button
-l "Button"
-c "command(string)";


where offsetCurve is a string value, obv. -c "command("string")"; does not work, but neither does delaring a variable $string and doing -c "command($string)";

Kind Regards,

Pete

NaughtyNathan
02-17-2011, 07:52 PM
ditch the brackets when calling from UI in MEL, makes it a little less cluttered. All literal strings and variables have to be catenated in MEL:

button -l "Button" -c ("command "+$variable);although it gets a bit more complicated if your $variable is a string with spaces or other tricky characters in...
button -l "Button" -c ("command \""+$string+"\"");:nathaN

CGTalk Moderation
02-17-2011, 07:52 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.