Bernie Wylde wrote: > I must be doing something incredibly stupid here. > > Can someone tell me why the following example creates a folder in the > wrong directory when using files$(_FSSpecSave... ? > Bernie, files$(_FSSpecSave... returns the FSSpec of the file you want to save, but in your case you want to create a folder instead so you must use the Toolbox function FSpDirCreate. Change your CreateFolder routine like this maybe: clear local fn CreateFolder(specSave as boolean) dim as str63 folderName dim as FSSpec fs dim as short @ vRefNum '~'1 long if specSave long if len( files$(_FSSpecSave, "Folder name…", "fsSpecSave Folder", fs)) // if not canceled, try to create a folder with the FSSpec returned long if fn FSpDirCreate( fs, _smCurrentScript, dirID ) != _noErr // handle here a possible failure end if end if xelse folderName = files$(_fSave, "Folder name…", "fSave Folder", vRefNum) long if folderName[0] vRefNum = folder(folderName, vRefNum) end if end if end fn Alain