Of course may the script require some adjustments before it runs in your 
situation. All depends on the naming rules you used for your pdf's. I use <cite 
key>.pdf, <cite key>_S.pdf, <cite key>_S2.pdf, <cite key>_S3.pdf etc. If you 
use another naming scheme, you need to adjust the script accordingly. You find 
all the needed information in the script itself (as I write on the website).

In this context critical sections are in routine getPresentFiles:

Statement

set theShellScript to "cd " & quoted form of workDir & " ; ls -1 " & theCiteKey 
& "*." & ext

changed to

set theShellScript to "cd " & quoted form of workDir & " ; ls -1 " & "*." & ext

finds all pdf's (or whatever the current value of 'ext' is) regardless of 
naming convention.

That adjustment may already all you need in your case, i.e. to get at least all 
pdf's linked to the currently selected BibDesk record. However, this makes 
little sense. The problem is how can BibDesk know which pdf goes into which 
record? If you use other rules, e.g. author or whatever, you have of course to 
adjust the script accordingly. E.g. if your naming convention should be

<author><year>.pdf

then, above statement should be

set theShellScript to "cd " & quoted form of workDir & " ; ls -1 " & theAuthor 
& theYear & "." & ext

and you need to populate the variables 'theAuthor' and 'theYear' with the 
values of the current record. This means enhancing following script section

on doFixPDFsAndURLs(thePub)


tell application "BibDesk"
tell thePub
set allLinkedFiles to (get POSIX path of linked files)
set theCiteKey to get cite key
set allLinkedURLs to (get linked URLs)
end tell
end tell

such that

on doFixPDFsAndURLs(thePub)

tell application "BibDesk"
tell thePub
set allLinkedFiles to (get POSIX path of linked files)
set theCiteKey to get cite key
                        set theAuthor to value of field "Author"
                        set theYear to value of field "Year"
set allLinkedURLs to (get linked URLs)
end tell
end tell


and then enhance the routine getPresentFiles accordingly to pass to it not only 
'theCiteKey' but also (or instead) 'theAuthor' and 'theYear", all depending on 
your pdf naming convention.

This should get you going. Sorry, can't spend more time on this helping you.

Sincerely yours,
Andreas


ETH Zurich
Prof. Dr. Andreas Fischlin
Systems Ecology - Institute of Integrative Biology
CHN E 21.1
Universitaetstrasse 16
8092 Zurich
SWITZERLAND

[email protected]<mailto:[email protected]>
www.sysecol.ethz.ch<http://www.sysecol.ethz.ch>

+41 44 633-6090 phone
+41 44 633-1136 fax
+41 79 221-4657 mobile

             Make it as simple as possible, but distrust it!
________________________________________________________________________



On 01/Sep/2010, at 15:21 , Sang-Heon Dan Shim wrote:

Dear Andreas,

Thanks for the answer.  I already downloaded 'Fix PDF and URL Links' and tried 
but did not work.  It should be due to my lack of knowledge on how the script 
works.

In preference, I added script hook for the import publication.  Then I open the 
Jabref bib file from File > Open.  This asks some conversion criteria and I 
leave them untouched to proceed to read.  This does not seem to change the file 
link correctly.

Thanks for help.

Dan

On Sep 1, 2010, at 8:38 AM, Fischlin Andreas wrote:

You find AppleScripts doing exactly this on my website:

http://se-server.ethz.ch/staff/af/bibdesk/index.html

but the scripts are very sophisticated and may need some adjustment. Yet, 
script 'Fix PDF and URL Links' does exactly what you need.

Regards,
Andreas


ETH Zurich
Prof. Dr. Andreas Fischlin
Systems Ecology - Institute of Integrative Biology
CHN E 21.1
Universitaetstrasse 16
8092 Zurich
SWITZERLAND

[email protected]<mailto:[email protected]>
www.sysecol.ethz.ch<http://www.sysecol.ethz.ch>

+41 44 633-6090 phone
+41 44 633-1136 fax
+41 79 221-4657 mobile

           Make it as simple as possible, but distrust it!
________________________________________________________________________



On 01/Sep/2010, at 13:10 , Sang-Heon Dan Shim wrote:

Hi,

I have been searching for scripts or tools to convert bib file made in Jabref 
to Bibdesk.  I have ~2000 references in my bib file with PDF links.  It seems 
that Bibdesk does not convert the PDF links generated by Jabref when it imports 
files.

I've searched archives and googled for the last couple of days.  I found some 
related discussions but so far I have not been able to find any actual 
applescripts or tools to do this.

Thanks for help.

Sang-Heon Dan Shim
[email protected]<mailto:[email protected]>





------------------------------------------------------------------------------
This SF.net<http://SF.net> Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Bibdesk-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
This SF.net<http://SF.net> Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Bibdesk-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Sang-Heon Dan Shim
[email protected]<mailto:[email protected]>





------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to