PDA

View Full Version : Syntax help needed - using " in maxscript


nielzen
06-20-2008, 10:51 AM
Hi All
Im quite new to maxscripting has gone head first into a quite large script - lerning by doing style and maybe because of my approach now im a bit stuck now:
I have a automatic system for setting up a lot of similar single object renders of my scene containing 200+ objects. Now i want the output filename to be the same af the objectname in max and therefore I have programmed maxscript to create a batch file that rename all of the renders... but one little thing is missing. The syntax in good old dos for renaming files dosn't allow any spaces except for the one seperating the two filenames and all my object are called: 'something - like - 5555.555' so that is no good. But when include one " at each end of the statement the rename completes flawless.
Is there any way that you can add " in maxscript? If do this: outputstring= """+name+" - "+number+""" if of cource fails. Is there a solution?

If not is it posible to trim all spaces in my outputstring?

Thanks

antonv
06-21-2008, 05:51 AM
It fails because max is looking for a string. The " character is a special character for max and is used to delimitate a string. If you want to use it inside a string you have to put the \ in front of it. So your code should look like this:


outputstring= "\"" + name + " - " + number + "\""

CGTalk Moderation
06-21-2008, 05:51 AM
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.