Hi all,
I want to display in a field, the filename that I have already loaded into a player. I've managed to get the filename into a field but it includes the path to the file, how do I return just the filename and it's extension?
Thanks in advance,
G
filenames and fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Something likesince Rev uses a slash "/" as its native file path separator, you can use that as the itemDelimiter. If you are working with raw Windows filepaths, then you may need to change "/" to "\" (slash to backslash) or adjust for other file systems as appropriate. If you use the ask file version, then Rev should automatically use the "/" in the path. You can change the itemDelimiter at will, and it will stick for that current handler, and revert to comma after the handler has exited.
Code: Select all
set the itemDelimiter to slash
answer file "Choose the file"
put the last item of it into theFileName
if theFileName is not empty then
-- and whatever other error trapping you need here
put theFileName into field "theFileNameField"
end if
Thank you very much
Thank you Sparkout, that's pushed me on a bit!
G
G