On Apr 14, 2014, at 12:36 PM, Ken Mankoff <mank...@gmail.com> wrote:

> On 2014-04-14 at 13:42, Charles Berry wrote:
> 
>> For this to work as you fantasize, you would need to enable the Finder
>> application to modify the part of the *.org file that encodes the
>> alias when you change the location of the aliased file just as the
>> Finder does to the alias when the location of the aliased file is
>> modified in the Finder.
> 
> I don't think so. I'm not sure how BibDesk handles it, but my BibTeX
> file is not modified when I move the PDF that is linked to an entry via
> that 1200 character field that encodes the alias. Clearly BibDesk does
> something neat to encode and decode that field, but once created, the OS
> nor Finder know anything about that line or the file containing it. I
> don't think Finder would need to know about a string in an Org file
> either.

We can look at a BibDesk file to see how it works.  It adds a special field 
like:

        Bdsk-File-1 = {YnBsaXN0MDDUA...AAAAAAAAAAAAAAAMO}

We guess that this base64 encoded, so we decode it (M-x base64-decode-region)  
This then gives us a binary plist (it starts with bplist) which we can turn 
into a readable form with M-: plutil -convert xml1 -o - - RET

This gives an xml representation of what BibDesk stores.  It’s an archived 
object of some kind, but I don’t know about OS X aliases to know what is the 
important part--I presume the NS.data portion.  It probably wouldn’t be too 
hard to borrow the code from BibDesk and extend Emacs to do the same thing, or 
write an external script.  I’m not sure whether it would be possible to do it 
without touching C/Obj-C.  I would be interested in using such a thing (in 
BibDesk .bib files actually), though probably not in writing it.  :-)

-Ivan

Reply via email to