I'm trying to write a script to change my JSTOR URLs to the proxy version
that works for my school. It should copy the URL from the URL field, change
the URL by a simple string substitution, and paste the result to the
My_Proxy_URL field.

It seems to be working up until somewhere in the replaceChars step. I'm sure
I'm just making some beginner's mistake. Here's my script:

-------------

tell application "BibDesk"
    set theDoc to document 1
    set thePubsSel to the selection of theDoc
    repeat with thePub in thePubsSel
        set theURL to the value of field "URL" of thePub
        if theURL contains "links.jstor.org" then
            set theURL2 to replaceChars(theURL, "links.jstor.org",
"0-www.jstor.org.skyline.cudenver.edu")
            set My_Proxy_URL to theURL2
        end if
    end repeat
end tell
----------------

Here's the Event Log:


tell application "BibDesk"
    get document 1
        document "Anthro Bib"
    get selection of document "Anthro Bib"
        {publication 8 of document "Anthro Bib"}
    get value of field "URL" of publication 8 of document "Anthro Bib"
        
"http://links.jstor.org/sici?sici=1558-8610%281972%2914%3Cii%3ATAOATH%3E2.0.
CO%3B2-P"
    
replaceChars("http://links.jstor.org/sici?sici=1558-8610%281972%2914%3Cii%3A
TAOATH%3E2.0.CO%3B2-P", "links.jstor.org",
"0-www.jstor.org.skyline.cudenver.edu")
        "BibDesk got an error: Can't continue replaceChars."

-------------------------

Thanks for any suggestions.
--Ingrid Giffin



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to