The bookmarkpath( function converts saved bookmark data (from the filebookmark( function) into a standard file path.


This function has one parameter:

bookmark – bookmark data saved with the filebookmark( function.


This function converts binary data generated by the filebookmark( function into a standard file path. This works even if the original file has been moved or renamed since the binary data was generated. If you are going to save a path permanently (in a database or file), you should use a bookmark instead of saving the text of the path. This example allows the user to choose an image with a dialog, then saves the name and location of that image in the myAvatar permanent variable.

local fileChoice
choosefileDialog fileChoice,".jpg.gif.png"
if fileChoice="" return endif
letpermanent myAvatar = filebookmark(fileChoice)

Later, the current path and name of the file can be extracted from the permanent variable by using the bookmarkpath( function. This will work even if the file has been moved or renamed since the user chose the file (of course it will return an error if the file has been deleted).

let avatarImagePath = bookmarkpath(myAvatar)

See Also


10.2NewNew in this version.