Re: Directory navigated to by menu File > Open
Re: Directory navigated to by menu File > Open
- Subject: Re: Directory navigated to by menu File > Open
- From: Lee Ann Rucker <email@hidden>
- Date: Fri, 16 Jan 2015 00:55:23 +0000
- Thread-topic: Directory navigated to by menu File > Open
On Jan 15, 2015, at 4:34 PM, Ken Thomases <email@hidden> wrote:
> On Jan 15, 2015, at 6:16 PM, Jerry Krinock <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden