Hi,

I've developed a composition which sources a folder with a number of movie files in it, then randomly shuffles all the files into a list, which i can then cycle through. I have two windows displaying in my composition. The first one is the video and the second one gives me the video name and a few other bits of information I need. However I want to only display the name of the file that is playing eg. Movie1.mov instead i get the full file path eg. file:///Users/sean/desktop/research/movies/Movie1. Can anyone help with a path that will allow me to only read in the file name of the selected item in the folder I have sourced.

Cheers, Sean

Comments

Hi @seanbyrne !

Bodysoulspirit's picture
Submitted by

Hi @seanbyrne !

See Jaymie her answer for the easiest technique.

Another method would be to split the path url by "/" separator, then split it by "." and choose the first item.

However, when I do that, I get some %XYZ%, some percent character for some long urls ... not sure why.
So I'm joining the composition which is a start, needs to be finished though :(

PS : Don't forget to set your folder path on the List Folder node, nothing won't happen unless.

No problem! It was added

jstrecker's picture
Submitted by

No problem! It was added fairly recently (1.2.0).

Do you mind if I leave your answer up? I think it's useful to show the technique of splitting on slashes. While Get File URL Values is probably better if you want the file name without extension, Split Text -> Get Last Item in List is nice if you do want the extension since you don't have to append it back on.

If you mean things like "%20"

jstrecker's picture
Submitted by

If you mean things like "%20" in place of a space in the file name, that's because the file name is URL-encoded. Characters, like space, that are not valid in URLs are replaced with special symbols. Since Get File URL Values decodes the URL-encoding, it would be a better choice if you have spaces or other special characters in your file names.