Page 1 of 1

url file path

Posted: Sun Dec 12, 2010 2:12 am
by urbaud
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.

Re: url file path

Posted: Sun Dec 12, 2010 9:01 am
by WaltBrown
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):

Code: Select all

put "myDataFile2" into fld "l1"
put the defaultFolder into fld "t1"
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:

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"
or something like that.

Walt

Re: url file path

Posted: Sun Dec 12, 2010 9:34 pm
by urbaud
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