Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nav services: how do I get my save location to equal my load location



On 7/24/04 6:34 PM, Bob Sabiston didst favor us with:

> On Jul 24, 2004, at 5:27 PM, Laurence Harris wrote:
>
>> On 7/24/04 4:56 PM, Bob Sabiston didst favor us with:
>>
>>> Hello,
>>> I am using nav services to load and save files. When I save my
>>> file, I want the location that comes up to be the same location as the
>>> file's location that was last loaded, if any. What do I have to do to
>>> ensure that? Do I have to set the default location after I load a
>>> file? I am specifiying a preference key, which is the same value, for
>>> my load and save dialogs, but what else do I need to do?
>>
>> The preference key should do it. If you're calling
>> CFPreferencesAppSynchronize the info should persist across launches. Be sure
>> you're using same key for multiple open and save dialogs only if you want
>> them to default to the same location each time, and use a different key for
>> other Nav dialogs which the user would use to navigate to another location.
>> You can look in you .plist prefs file to see if information is being saved.
>> You'll see entries like this:
>>
>> AppleNavServices:ChooseFile:1097623923:Path
>>
>> where 1097623923 is the key. This one is 'Alis' (that's one of my keys).
>>
>> Larry
>>
>
> So, is this Tech Q&A file no longer valid? Cuz I just spent an hour
> changing over to this method...
>
> http://developer.apple.com/qa/qa2001/qa1151.html
>
>
> Where are my .plist prefs?

The standard place is your com.yourcompany.yourproduct.plist file in the
Preferences folder (of all places). I'll confess some surprise that this
late in the game you aren't familiar with CFPreferences, which is supported
in CarbonLib and all versions of Mac OS X, and which all of Apple's Mac OS X
applications use. If you use CFPReferences at all, then when you write out
preferences you've set, prefs like Nav Services and HIToolbar also get saved
as well.

> Because it isn't working--I would like to
> see what values are being saved.

It was not clear from the way you worded your original question exactly what
you want to do. If you simply want the last location used to be used again,
then CFPReferences + prefs key is enough. If you want to force it to go to a
specific location, then NavCustomControl() with kNavCtlSetLocation is the
way to go, although I an FSRefs for the AEDesc, instead of an FSSpec.

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: nav services: how do I get my save location to equal my load location (From: Bob Sabiston <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.