On 13 Jun 2007, at 3:56 AM, Adam R. Maxwell wrote:

>
> On Jun 12, 2007, at 06:19, Zvi Biener wrote:
>
>> Dear All,
>> Apologies if this message shows up on the list twice -- I sent it,
>> but didn't see it hit the list, so I'm sending it again.
>>
>> I'm trying to write some applescripts (for quicksilver
>> integration, and export of linked files, which I'll post to this list
>> as soon as they are done), but need some help using the shell  
>> command:
>>
>> defaults read edu.ucsd.cs.mmccrack.bibdesk "xxx"
>>
>>
>> 1) How do I read the name of the file BD opens by default (if that
>> option is saved)? I see an option called
>> "BDSKDefaultBibFileAliasKey", but I'm not sure how to use its value.
>
> You can't read the name as a string.  It's an alias stored as NSData,
> and probably completely useless unless you write a program that
> converts it to a file reference (FSRef, path, URL).  We use a class
> called BDAlias to do this, so you can rename/move the file apart from
> BibDesk and it will still work.
>

I wonder why you'd need this? Bibdesk automatically opens this file  
when you activate it and the file isn't open.

>> 2) How do I read the last opened file? The command:
>> defaults read edu.ucsd.cs.mmccrack.bibdesk "Last Open FileNames"
>> gives me more than I need. Is there a way to invoke "defaults" that
>> narrows this dictionary down, or do I have to do some string
>> manipulation myself?
>
> The result of "Last Open FileNames" is an array of dictionaries, with
> filename and alias objects.  I'm not aware of a way to read this
> directly through the defaults command.
>

Also note that these are not exactly the last opened files, but  
rather the files that were open the last time you quit BibDesk.

Christiaan

> I can help you write a new shell tool to read these, if that's
> acceptable, but keep in mind that these preferences have changed in
> the past and may change in future.
>
> -- 
> Adam



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to