On 2008-02-08, at 2:21 PM, Adam R. Maxwell wrote:

>
> On Friday, February 08, 2008, at 02:12PM, "Jan Erik Moström" <[EMAIL 
> PROTECTED] 
> > wrote:
>> Adam R. Maxwell <[EMAIL PROTECTED]> 08-02-08 14.00
>>
>>> The old format is unsupported as of 1.3.13.  Some of the UI is still
>>> present (you can display legacy file/URL icons in the main table),  
>>> but
>>> autofile is only supported in the new scheme.
>>
>> OK, thanks for the answer. I'll have to think about what to do.
>>
>>> They're ugly, but they're also ASCII text and harmless in your  
>>> bibtex
>>> file.  Non-mac or non-BibDesk users can ignore them
>>
>> Yep, but it's kind of difficult to see what the referenced file
>> is ;-)
>
> You haven't said exactly what you're trying to accomplish, so I just  
> guessed at the problem.  Do the people you share the BibTeX file  
> with also have access to the attachments?  In that case, you may  
> want to set up a script hook that copies the autofiled link as a  
> path for other users.
>
> In any case, I'd advise you to keep using the aliases for your own  
> use, rather than replacing them with paths, since that will cause  
> current and future headaches.  Incidentally, other BibDesk users  
> should also be able to see them as file names in the UI, even if the  
> files don't exist.

Probably your best solution is to use script hooks. The below script  
will take the path of the latest linked file, remove the directory of  
the bib file from that path, and paste the relative path of the latest  
linked file as the local-url field. I have it set to run on autofile.

using terms from application "BibDesk"
        on perform BibDesk action with publications thePubs for script hook  
theScriptHook
                tell application "BibDesk"
                        set theField to get field name of theScriptHook as 
string
                        set newValues to new values of theScriptHook as string
                        if theField is "Local File" then
                                set theDocDir to my getDocDir(document 1)
                                display dialog theDocDir
                                repeat with thePub in thePubs
                                        set theValue to my 
replaceChars(newValues, theDocDir, "")
                                        set the value of field "local-url" of 
thePub to theValue
                                end repeat
                        end if
                end tell
        end perform BibDesk action with publications
end using terms from

on getDocDir(theDoc)
        tell application "BibDesk"
                --get the papers path
                set theDocPath to the path of theDoc as string
                set theDocName to the name of theDoc as string
                set theDocDir to my replaceChars(theDocPath, theDocName, "")
                return theDocDir
        end tell
end getDocDir

on replaceChars(this_text, search_string, replacement_string)
        if this_text contains the search_string then
                set oldAStid to AppleScript's text item delimiters
                set AppleScript's text item delimiters to the search_string
                set the item_list to every text item of this_text
                set AppleScript's text item delimiters to the replacement_string
                set this_text to the item_list as string
                set AppleScript's text item delimiters to oldAStid
        end if
        return this_text
end replaceChars
-------------------------------------------------------------------------
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