Hello everybody,
I have a problem associated with the changes in linking to files in
combination with how I used to deal with it (.e., not a problem with
BibDesk itself). I would like to get some suggestions on how I can
change or improve my procedures to adapt to the new way.
Some background: If I am not mistaken the autofile feature is
supposed to help you keep order in your linked files by automatically
naming them correctly and putting them in the right place once you
associate them (e.g., by drag&drop onto a reference) onto a
reference. What this way of linking files and references assumes is
that you already have a reference and then, e.g., download a file. I
have never used the autofile feature myself for the simple reason
that, usually, I work the other way around. I (or one of my
coworkers) would typically read some pdf files, and save them to disk
if I want to keep them (according to a specified naming scheme, and
into a specified literature folder). At a later point, I would search
& download the references (e.g., via SciFinder; thanks, Adam!) and
import them to BibDesk. So, the pdf files are already in the right
place, and they have the right name; what is missing is the
association with the references.
In the past, I solved the problem by using an AppleScript that
Christiaan (thanks!) had put together for me for this purpose (see at
the end of this email). For all selected references, it looked in my
literature folder, whether a file citekey.pdf existed and then set
the path of the field local-url to "path/to/our/literature/folder/
citekey.pdf". I already tried to just replace "local-url" in the
AppleScript with "local file" but this did not work (I assume because
the content of the field "local file" is not supposed to be a path)
Is there a way to fix the AppleScript?
Is there another good way of dealing with this situation (assuming
that a large number of papers is involved; for some reason, the
conversion of the old local-urls to "local field" did not work in my
case; I now have no linked files - no big drama, I have a backup)?
Would it be a desirable (and implementable) feature for BibDesk to
scan the specified literature folder whether files exist with a file
name beginning with "citekey" and just link them automatically?
Thanks for your input
Holger
############
tell document 1 of application "BibDesk"
try
set the ChooseAction to the button returned of ¬
(display dialog "Do you also want all references to
files not
present in your specified literature folder to be removed?" buttons
{"Cancel", "Yes", "No"} default button 3)
if the ChooseAction is not "Cancel" then
set the SelectedPublications to the selection
repeat with theActivePublication in the
SelectedPublications
set the citeKey to get cite key of
theActivePublication
set the LiteratureFolder to (((the path to the
home folder) as
string) & "Documents:Science:Literature:") as string
set the RequestedFile to (the LiteratureFolder
& the citeKey &
".pdf") as string
tell application "Finder"
set the fileExistCheck to (file
RequestedFile exists)
end tell
if the fileExistCheck is true then
set value of field "Local File" of
theActivePublication to "~/
Documents/Science/Literature/" & the citeKey & ".pdf"
else
if the ChooseAction is "Yes" then
set value of field "Local File"
of theActivePublication to ""
end if
end if
end repeat
end if
end try
end tell
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users