Save AS Dialog initialDirectory problem

Good Evening,

I have looked and looked and i hope overlooked something : )

I wish to start the save as dialog with a particular directory.
The directory seems to get loaded and is valid (looking in debugger)

Sometimes it works. But sometimes not.

Saving a file to a different directory starts the problem
but i want to use the one (default) initial directory every time

dim dataFile as folderitem
dim dlg as new SaveAsDialog

  if gMoleculesDataFolder.Exists  then   // and it should!
            dlg.InitialDirectory = gMoleculesDataFolder
  end if

dlg.SuggestedFileName = currentMol.name
dataFile = dlg.ShowModal()

all looks good in the debugger, but the save file dialog
will kind of flash to the correct location and then go to my /users/home directory

It will stay that way until i tunnel back to the correct directory,
even after re-running the program.

Some kind of persistence ?

I am using XOJO 2014 Release 1.1,
system OSX 10.9.3

Thanks !
Judy

if gMoleculesDataFolder.Exists then

are you sure it is a DIRECTORY and not a path to a file, bundle or app?

I use code almost identical to that (save versions) and have no problems

Good idea

… but no, definitely a folder

OK, found the issue

The program still is being compiled under Carbon…
I have (at least one probably many ) nil object issues under Cocoa.
I previously didn’t feel compelled enough to sort them out…

** Apparently the SaveAsDialog problem seems to be a problem only under Carbon, not Cocoa
( I have making a newer, smaller subset of my program for test)

must convert Joy, joy : )

Judy