Edit name

Hi Guys i am having problems with removing parts of the name in maxscript.

For instance i have 2 different edittext,
in 1 text its test.png
in the other its box.png

i want to press a button and it removes the .png from both texts.

thanks in advance

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jos's picture

getFilenameFile

you can use :

getFilenameFile "box.png" 

(this returns "box")

Mrjacks2o's picture

Thanks for the reply

Thanks for the reply it worked great for a text i entered in maxscript.
but what if i input a random text lets say box101.png while the script is running how can i use the script to remove the .png? thanks :)

fileName.text = getFilenameFile ".jpg" tried that but it removed all of the text

jos's picture

varText = edtText.text -- get

varText = edtText.text -- get input from user
fileName.text = getFilenameFile varText -- remove extention from input

getFilenameFile ".jpg" will return an emty string because getFilenameFile will remove the extention and ".jpg" is only an extention.
check maxscript help for more info. search for getFilenameFile.

Mrjacks2o's picture

Nice!!!!

Thanks allot it was exactly what i was looking for!!!!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.