Stupid question here,
I have files where the groupnames are that of the filename. I’m trying to trim the filename and an underscore from ONLY grouphead’s names but somehow can’t get the script to work.
basename = getFilenamefile(maxfilename) for o in selection where isgrouphead o do ( o.name = trimleft (basename + "_" as string) )
But trimleft removes everything after the underscore. If I use trimright, the same issue.
It’s actually doing the opposite of what I want. I have tried searching about string but that goes a little above my head.
Ive tried replace string but cant figure out the digits in the code e.g. From maxhelp
s1=replace s 5 3 “inserted string”
So i could for example count the filename characters but that would be extra work. Any suggestions how I would be able to use replace?