SetCurrentDirectory() & SaveFileRequester()

Mac OSX specific forum
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

SetCurrentDirectory() & SaveFileRequester()

Post by WilliamL »

How do I set the directory so that, when the SaveFileRequester() is called, a folder of my choice is already selected. Right now the folder that appears seems to be the last folder that was used.

Code: Select all

;GetCurrentDirectory() ; < works fine and shows the folder I want!
SetCurrentDirectory(GetCurrentDirectory()) ; < has no effect on changing which folder is shown below
filename$=SaveFileRequester("Save chart...",Chart\cname+".SXChart","Text (*.txt) | *.SXChart; *.txt",0)
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: SetCurrentDirectory() & SaveFileRequester()

Post by Demivec »

PB Manual wrote:Filename$ = SaveFileRequester(Title$, DefaultFile$, Pattern$, PatternPosition)
The DefaultFile$ is useful to initialise the requester in the right directory and with the right filename.

Does that work for you?
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: SetCurrentDirectory() & SaveFileRequester()

Post by WilliamL »

Oh, yes, I see that it actually says that the folder is initialized with SaveFileRequester().

Code: Select all

filename$=SaveFileRequester("Save chart...",FilePath+Chart\cname+".SXChart","Text (*.txt) | *.SXChart; *.txt",0)
This (code above) gives me the whole path but did not give the folder that was at the end of the path. (still the random folder)

I was reading the thread 'How to: Change current directory' and was off trying to SetCurrentDirectory.

Anyway, neither is working although the your method should work.

[two days later]
Maybe I should report it as a bug?
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
Post Reply