How to Export Filename only (not full Path, no extension)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

tprothma

How to Export Filename only (not full Path, no extension)

Post by tprothma » Mon May 17, 2004 12:08 pm

I've searched all of the forum topics, even downloaded the scripting help file, but can't figure out the syntax to output the filename (would actually prefer it without the extension)

For instance, I want to script to give me an column for the file named "c:\My Documents\Tweetie.mp3". itm.Path gives the full path and filename + extension. I want only the filename "Tweetie" and would prefer a separate one for file extension "mp3".

I have tried this for Excel:
WS.Cells(i+2,8).Value = itm.Path
WS.Cells(i+2,9).Value = itm.FileName

But it doesn't work.

Is there an itm.somthing that would work.
Alternatively might be able to parse itm.path backwards util I reach a \ in the string, but I'm not good at scripting.

Any help would be appreciated.

Thanks,
Tim

Lowlander
Posts: 46156
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Post by Lowlander » Tue May 18, 2004 9:13 am

You could have the code delete the last 4 characters (extension only) or everything after the last /. The code I don't know either right now, but there are many examples available on the net.
Lowlander (MediaMonkey user since 2003)

Post Reply