Current Directory

If I want to store the the current directory of the last loaded file. I am using the following which isn’t quite correct
Dim f as folderitem
dlg=New OpenDialog
if currentdir = nil then
dlg.initialDirectory = SpecialFolder.Documents’Volume(0).Child(“Documents”)
dlg.initialDirectory = currentdir
end if
if f <> Nil then
currentdir = f
currentfile = f.Name

currentdir = f.parent

You don’t have to. OpenDialog will save it and load the last used location for you on both Mac and Windows if you do not touch the InitialDirectory setting at all. It’s a system level thing.