On Jan 15, 2015, at 4:34 PM, Ken Thomases <k...@codeweavers.com> wrote:

> On Jan 15, 2015, at 6:16 PM, Jerry Krinock <je...@ieee.org> wrote:
> 
>> I have noticed that the directory which is navigated to in the File > Open 
>> dialog of my NSDocument-based application does not give what I expect, and 
>> am trying to control it.
> 
>> So, great, I thought, just override -currentDirectory in the 
>> NSDocumentController subclass for TextEdit, and I can make it go wherever I 
>> want to.
>> 
>> But, no.  Although my -currentDirectory override is invoked when I click 
>> menu > File > Open, any path I return seems to be ignored.
> 
> That's unfortunate.  It definitely seems like that should have worked.
> 
>> If no document is open (no “current document”), it seems to always somehow 
>> remember and go to the directory of the last document that was opened, even 
>> if this was in a long-app application run.  This is the case even if I 
>> delete the “recents” file 
>> ~/Library/Preferences/com.apple.TextEdit.LSSharedFileList.plist before 
>> launching.  And no such path is shown when I run the command “defaults 
>> com.appleTextEdit”.  The system must be remembering this path elsewhere.
> 
> On my 10.9.5 system, the last location is remembered in the defaults for 
> TextEdit.  The command "defaults read com.apple.TextEdit 
> NSNavLastRootDirectory" provides it.

defaults read your.app.here NSNavLastRootDirectory

will provide it for your app too; our code comment indicates we were told this 
at some long-past WWDC.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to