A search on this subject gives 14 or so pages
of results which would take quite a while to
read so...
When I open a file with
put URL ("file:" & it) into FileData
how do I get the name of the file that's opened?
Getting the name of the opened file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Getting the name of the opened file
Life is just a bowl of cherries.
bjb,
Assuming that the it variable contains a valid file name:
Best,
Mark
Assuming that the it variable contains a valid file name:
Code: Select all
put it into myFilePath
set the itemDel to slash
put last item of myFilePath into myFileName
put URL ("file:" & myFilePath) into myFileData
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Getting the name of the opened file
Thanks Mark.
Wise to add code to save itemDel and
restore after getting the file name else
in my case the file wouldn't load
Wise to add code to save itemDel and
restore after getting the file name else
in my case the file wouldn't load
Code: Select all
put it into myFilePath
put itemDel into someVar
set the itemDel to slash
put last item of myFilePath into myFileName
set itemDel to someVar
put URL ("file:" & myFilePath) into myFileData
Life is just a bowl of cherries.