GetFolder Item Path

I used this code in real basic to load local html files into a web browser. It doesn’t seem to work in Xojo.


if gFolder <> nil and gFolder.Exists then

bmURL = gFolder.URLPath
Browser.LoadURL bmURL


MsgBox"Data File Error"

End if [/code]

Does Xojo need a “Special Folder” possibly as in iOS?

Xojo has a SpecialFolder for the classic framework, however it doesn’t access the locations with the CopyFiles build steps.

If you’re packaging your app correctly (CopyFiles step to resources), you can use the TPSF to get access to the build steps with a classic framework FolderItem:

Thanks Tim, I’ll investigate this further.

Also try

gFolder = GetFolderItem("")
msgbox gFolder.NativePath

It’s quite possible the app is somewhere other than where you think it is.


It’s looking for the folder in the project debug folder where, of course, it doesn’t reside. It’s on my desktop. I’m wondering, since it’s a relative path, why it’s not being copied into resources during a debug run.

You have to set up a build copy step in order to put such a file into resources. Xojo puts things into resources that you have dragged into the project and made them project items, images and the like. But any external file you’d have to set up yourself.

Thanks Tim,

I tried that but it didn’t work. I’m thinking the file might be to large. There are hundreds of html pages and the folder size is over 50mb. Possibly bringing all the html pages into the app as shortcuts might do it along with the built copy step. I’ll try that today.