On 05/08/08 11:44, "Adam M. Goldstein" <[EMAIL PROTECTED]> wrote:

> On May 8, 2008, at 10:44 AM, James Owen wrote:
> 
>>> However, for some reason, BibDesk is no longer putting the contents of the
>>> doi: field into the Doi: field in my bibtex archive.  It used to, before
>>> 1.3.15. is there some problem with case sensitivity? If I added a "doi"
>>> field as well as a "Doi" field, would that work? It seems to know that it is
>>> a DOI, as when I paste in the DOI, a link appears in the sidebar to
>>> dx.doi.org/<DOI>.
>>> 
>>> 
>> 
> I am still getting used to BD's new behavior myself, but it sounds like you
> intend to copy the doi to a doi field, rather than (or in addition to) using
> it as a linked file. I am not sure it with 1.3.15 when the change occurred,
> but BD, as you probably know, now handles links and attached files
> independently of the url and doi fields.
> 
> In general, the behavior seems to be that if you drop a link or doi onto a
> record, it will be handled as an attached file, and put into the attached
> files pane.

Only if it's a well-formed URL.  A DOI by itself will be ignored if dropped
on the file pane, unless it has a resolver associated with it (such as
http://dx.doi.org).  If it has a doi: prefix, it might be recognized as a
URL, but probably won't be functional.

Note: DOI field contents will be converted to linked URLs automatically when
reopening the file.  See the archives for discussion of this.
 
> If you want the doi or url to get into the doi or url field, you have to copy
> it there yourself.

Alex Montgomery posted a cool script hook here last week for copying
contents of the DOI field to a linked URL automagically.  I'm appending a
slightly modified version that I'm currently using.  Paste it into Script
Editor, save as a .scpt, and associate it with the "Change Field" hook in
prefs.  Line breaks will probably be messed up, so watch for that.

using terms from application "BibDesk"
    on perform BibDesk action with publications thePubs for script hook
theScriptHook
        tell application "BibDesk"
            set AppleScript's text item delimiters to ""
            set theField to get field name of theScriptHook as string
            if theField is "doi" then
                repeat with thePub in thePubs
                   
                    set oldDOI to old values of theScriptHook as string
                   
                    -- remove non-numeric prefix from old DOI
                    repeat with iChar from 1 to number of characters of
oldDOI
                        if character iChar of oldDOI is in "0123456789" then
exit repeat
                    end repeat
                    set oldDOI to texts iChar thru -1 of oldDOI
                   
                    -- convert to a URL string for comparison with linked
files
                    -- remove any linked file that's set to the old value
                    set oldURL to "http://dx.doi.org/"; & oldDOI
                    repeat with iURL from 1 to count of linked URLs of
thePub
                        if linked URL iURL of thePub = oldURL then
                            delete linked URL iURL of thePub
                        end if
                    end repeat
                   
                    set newDOI to new values of theScriptHook as string
                   
                    -- remove non-numeric prefix from new DOI
                    repeat with iChar from 1 to number of characters of
newDOI
                        if character iChar of newDOI is in "0123456789" then
exit repeat
                    end repeat
                    set newDOI to texts iChar thru -1 of newDOI
                   
                    -- leave the original DOI field intact, but create a
valid linked URL from it
                    if newDOI is not "" then make new linked URL with data
"http://dx.doi.org/"; & newDOI at end of linked URLs of thePub
                end repeat
            end if
        end tell
    end perform BibDesk action with publications
end using terms from


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to