create folder on a network/share drive

I am having trouble trying to find a way to make a folder on a network/share drive. I see lots of how-to’s about making a folder on the desktop… not wanting to do that.
It would be great if someone could steer me in the proper direction and/or let me know how to do it it would be much appreciated.
Icing on the cake would be to also let me know how to return the path as text…
Thanks!

Once you have a valid folderitem (f As folderitem) to the network drive, you should be able to just do
f.CreateAsFolder just as you would on the local machine. Provided, of course, that you have permission to do that on the specified drive. Is it a permissions issue you are running into? Likewise, f.NativePath will return the path as text to that valid folderitem.

dim f as folderitem = new folderItem("/Volumes/mountedDevice/test", FolderItem.PathTypeShell)
f.createAsFolder

system.debuglog(f.ShellPath)

thank you all!
i guess the problem i am having is that i can stick a static path in it and it works but i need it to be chosen path via a dialog.

thanks again

Set the dilog.initialdirectory to specialFolder.Mount

Looks like I’ve got a good start!

Thank you for your help and being patient with a newby!

okay…now i feel stupid… how would i create subfolders within this new folder?

would i call on this system.debuglog(f.ShellPath) ? if so… how?

thanks again!

once you have the initial folder item then you do something like

[code]
subfolder = f.Child(“what ever special name you want”)
if subfolder is nil then
// whoops something bad happened
// do whatever error handling etc you need to do
// BAIL !
return
end if
if subfolder.exists then
// whoops it already exists
// do whatever error handling etc you need to do
// BAIL !
return
end if

f = subFolder
f.CreateAsFolder()
if f.errorCode <> 0 then
// error <> 0 can signal an error creating the directory
// do whatever error handling etc you need to do
// BAIL !
return
end if

// f now points at volume.“what ever special name you want” directory

// lather rinse & create more subfolders by doing the same a few more times[/code]

okay… i do not know how to return the path to create the subfolders… applescript seems so much easier but it no longer works for us…

Dim dlg as New SaveAsDialog
dim f as FolderItem
dlg.InitialDirectory=SpecialFolder.Mount
dlg.SuggestedFileName=TextField1.Text
dlg.promptText=“Enter Folder Name”
f=dlg.ShowModal()
f.CreateAsFolder

Continue with your code after the folder(f) has been created and use it to digg further into the directory structure with subfolders like Norman explained above.
(pseudo code…)

f.CreateAsFolder
Dim sub1 as FolderItem = f.Child("name_of_subfolder")
sub1.CreateAsFolder

Dim sub2 as FolderItem = sub1.Child("name_of_another_subfolder")
sub2.CreateAsFolder
.......

Of cource you need to see if the parent folders are created and didn’t get an error :slight_smile:

okay… will give it a shot… i was able to display a message box showing me the absolutepath…

thank you. cannot believe the help…has got be be one of the best forums out there.

just want to say thanks again… i finally get it…

lots and lots of if thens

cheers all and have a great holiday!