Parsing a path for GetFolderItem

[code]dbLR_Local.databaseFile = getFolderItem("").child( “LR_Test” ).child( “LR_Test.lrcat” )

[/code]

I have a preferences table that has, among other things, the default path to a database that the app uses.
The path is currently: Macintosh HD:Users:Bill:Dropbox:WPP:Software:LR_Test:
I currently have the GetFolderItem path hardcoded into the method but I want to get the location from the field in the Preferences table.

Is there an easy way to parse the path into the proper GetFolderItem command or am I going to have to parse it based on the colons and build child…child…

thanks guys, ya’ll are always a huge help.

I would store the SaveInfo string that the FolderItem provides. It’s cross-platform and works like an alias, and you can easily create a FolderItem from it.

You might have to Base64- or Hex-encode the string into the database, I’m not sure.

Macintosh HD:Users:Bill:Dropbox:WPP:Software:LR_Test

Is your app also in this folder?
If so, you could use App.ExecutableFile.Parent.Parent.Child(“LR_Test.lrcat”)

If you have a bunch of old-style colon separated paths stored somewhere that you want to read in as a folderitem and then start using the saveinfo Kem was referring to, you can do:

dim pth as string = "Macintosh HD:Users:Bill:Dropbox:WPP:Software:LR_Test:" dim f as new FolderItem(pth, FolderItem.PathTypeAbsolute)

Without having to create the child structure.

Thanks Scott, your solution worked perfectly…