Crossplatform folderItem path

There doesn’t seem to be a folder item path that is consistent across Mac and PC.
I had been using absolute path to get the path to a folder where my app will find some files. Then I store that path in a string and save it with other data on the hard drive. I want to be able to read the string with the path, and open the folder on windows or Mac OS. Yes both platforms need to find it in the same place on a shared drive.

FolderItem.NativePath should do it.

However, on macOS (I don’t know about Windows or Linux), it is advised to store a Bookmark instead, so the file can be retrieved even if it has moved or been renamed.

If you use a Bookmark on Mac OS and the NativePath on Windows and Linux, you won’t get the behaviour the OP actually asked for (that is, a single path useable on all platforms).

Not built-in, but using a loop, you can construct it yourself. You just have to know to what it should be relative to (since you can’t really rely on a volume’s name, where several volumes may share the same).
For instance:

var f as folderitem
var Items() as string

f=TargetItem 'The item you want to store
do
if f=nil then exit 'Either “TargetItem” is nil or we reached the “parent of the volume”.

Items.AddRowAt 0,f.Name 'Insert the current folder’s name
f=f.Parent 'Move up
Loop
MessageBox String.FromArray(items,":") //“:” is the single visible character that can’t be found in a filename; you may choose to use unprintable characters like chr(0) or chr(8) if you store in binary