How do I show the current file name and path using the URL file notation? I want to show the file name in a label field and show the file's path in another label field.
1. get url "file:myDataFile2"
2. put the longFilePath of it into fld "l1"
3. put url "file:myDataFile2" into fld "t1"
If I use line 2, it puts the contents of the file into the label field-I just want the path.
url file path
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: url file path
urbaud,
I don't understand what you are trying to do. The "get url file" function needs a path as well, so your path is in the defaultFolder function. You already have the file name. So it appears what you want to do is (and you don't need URL notation):
Or is there more to the question?
The longFilePath function is only for Windows. If you had a Windows path in the 8.3 format in a variable named tMyOldPath , then you might use:
or something like that.
Walt
I don't understand what you are trying to do. The "get url file" function needs a path as well, so your path is in the defaultFolder function. You already have the file name. So it appears what you want to do is (and you don't need URL notation):
Code: Select all
put "myDataFile2" into fld "l1"
put the defaultFolder into fld "t1"
The longFilePath function is only for Windows. If you had a Windows path in the 8.3 format in a variable named tMyOldPath , then you might use:
Code: Select all
put the longFilePath of tMyOldPath into tMyNewPath
set the itemDelim to "/"
put the last item of tMyNewPath into fld "l1"
delete the last item of tMyNewPath
put tMyNewPath into fld "t1"
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: url file path
Hi Walt,
Thanks for responding to my post. I found your suggestions helpful and the info about the longFilePath being used only with windows is something I didn't know about, as I'm somewhat new to Rev. I also realized, again, from your suggestions, that I should use the defaultFolder function. So, thanks again for your help.
Dan
Thanks for responding to my post. I found your suggestions helpful and the info about the longFilePath being used only with windows is something I didn't know about, as I'm somewhat new to Rev. I also realized, again, from your suggestions, that I should use the defaultFolder function. So, thanks again for your help.
Dan
urbaud