On Jul 26, 2009, at 10:59 PM, Jonas Zimmermann wrote:
Hi, I jsut wanted to use a snippet from AutogenerateLinkedURLScriptHook for, well, creating a URL from PubMed (see my script below). It seems the 'parse format' verb doesn't work (anymore) as in the sample. (a) even in a 'tell thePub' block, an explicit 'for field "Url" of thePub' is needed else AppleScript will complain of an error 5; but
That's an error in the script, I fixed it in the linked script on the wiki.
even worse (b) the formated string will only be 'http://www.pubmedcentral.nih.gov/picrender.fcgi?blobtype=pdf&artid=' , i.e. the %f{Pmid} part will not be replaced (yes, my publication has the Pmid field, the script would've stopped before otherwise)
Apparently digits are considered invalid in URL fields. That's wrong, I'll have it fixed in the next nightly.
am I doing something wrong here? I'm using 1.3.21 (1525). Thanks, jonas
Thanks, Christiaan
property theFormatString : "http://www.pubmedcentral.nih.gov/picrender.fcgi?blobtype=pdf&artid= %f{Pmid}" property theRequiredFields : {"Pmid"} tell application "BibDesk" -- without documents there is no selection, so nothing to do if (count of documents) = 0 then beep display dialog "No documents found." buttons {"•"} default button 1 giving up after 3 end if set thePublications to selection of document 1 repeat with thePub in thePublications tell thePub -- check that we can generate the URL set canGenerate to true repeat with theField in theRequiredFields if (value of field theField is "") then ¬ set canGenerate to no end repeat if canGenerate then -- generate a new value for the field, we use the "Url" field as a dummy set newValue to parse format theFormatString for field "Url" of thePub if (newValue is not "") and (newValue is not in (get linked URLs)) then ¬ add newValue to end of linked URLs end if end tell end repeat end tell
------------------------------------------------------------------------------
_______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
