Getting the Folder Name

Im using GetOpenFolderItem to select a specific file type:-

	Dim aviType As New FileType
	aviType.Name = "video/avi"
	aviType.MacType = "AVI"
	aviType.MacCreator = "sjs"
	aviType.Extensions = "avi"

f = GetOpenFolderItem( aviType )

How do I store the selected folder location as a string?
I tried f.NativePath but it returned the path with the filename.
I tried f.Directory but that seems to be a boolean

you want JUST the folder name?

f.displayname

The lang ref is your friend

Have a look at http://documentation.xojo.com/index.php/FolderItem.GetSaveInfo. Do a base64 before you save the data.

[quote=305569:@Dave S]you want JUST the folder name?

f.displayname

The lang ref is your friend[/quote]
Hi Dave - That seems to just display the filename

folder name?

Dim f As FolderItem f = SelectFolder If f <> Nil Then MsgBox(f.Name) End If

Name of the folder holding the item you just selected?

use the parent property

[code]
dim f as New folderitem
f=GetOpenFolderItem( aviType )

if f.parent <> Nil then
MsgBox f.parent.Name
end if[/code]

Maybe Im not explaining this too well…
I need the full path (of the file I have selected) as a string - but not including the filename
eg.

Path to file:
/Users/stuartsykes/Desktop/Films/new.avi …(this quite easy to get using f.NativePath)

But I need the full path eg:
Path to folder:
/Users/stuartsykes/Desktop/Films/

[quote=305574:@Jeff Tullin]folder name?

Dim f As FolderItem f = SelectFolder If f <> Nil Then MsgBox(f.Name) End If

Name of the folder holding the item you just selected?

use the parent property

[code]
dim f as New folderitem
f=GetOpenFolderItem( aviType )

if f.parent <> Nil then
MsgBox f.parent.Name
end if[/code][/quote]

This does display the folder name but not the full path

f.parent.shellpath

Thanks Michel - Thats got it :slight_smile:

By the way - just tried out RubberViews - works great - thinking of buying it - any Christmas offers on at the moment :slight_smile:

edit… Michel got in there.

also
f.parent.nativepath
f.parent.absolutepath

you have some choices here…

[quote=305582:@Jeff Tullin]edit… Michel got in there.

also
f.parent.nativepath
f.parent.absolutepath

you have some choices here…[/quote]

Thanks Jeff :slight_smile:

[quote=305581:@Stuart Sykes]Thanks Michel - Thats got it :slight_smile:

By the way - just tried out RubberViews - works great - thinking of buying it - any Christmas offers on at the moment :)[/quote]

Unfortunately, Black Friday week has elapsed. There will be other deals coming :wink: