Sorry, I had a mistake in the AppleScript: Please replace "tell aPub" with "tell thePub".
Regards, Andreas > > What seems to be missing is a loop over all records in current selection, > which may look similar to following > > set thePubs to selection > if (count of thePubs) > 0 then > repeat with thePub in thePubs > tell aPub > set theAuthor to value of field "Author" > set value of field "Doi" to "10.1007/s10584-010-9923-5" > ... > etc. > ... > end tell > end repeat > else > beep > end if > > > Regards, > Andreas > > > > -k. > > > > > > On Fri, Jan 24, 2014 at 8:11 PM, Ken Mankoff > <[email protected]<mailto:[email protected]>> wrote: > So I've made some progress on this applescript but seek some help from those > on this list who have used applescript before and understand the BibDesk > dictionary a bit. I now can drag PDFs into BibDesk where they get blank > records. I can then hit CMD+SHFT+P and the full BibTeX record is displayed > from pdfmeat.py. What I need help with is looping through each element of > this BibTeX record and inserting it into the current blank one. My current > code follows. Any help/hints will be much appreciated. > > Thanks, > > -k. > > tell application "BibDesk" > set theDoc to document 1 > tell theDoc > set theSel to selection > set thePub to item 1 of theSel > tell thePub > -- current (probably empty?) BibTeX record > set curBibTeXRecord to get BibTeX string of thePub > -- get the BibTeX record using pdfmeat.py. Wrap it in a shell script > because it needs a full path, write access to a folder, etc. > set theFiles to get linked files > set thePath to POSIX path of theFiles > set shellCmd to "/Users/mankoff/bin/pdfmeat.sh " & "'" & thePath & "'" > set pdfMeatOutput to do shell script shellCmd > --display dialog pdfMeatOutput > --display dialog curBibTeXRecord > end tell > end tell > end tell > > > > > On Wed, Jan 8, 2014 at 8:49 PM, Ken Mankoff > <[email protected]<mailto:[email protected]>> wrote: > I just discovered pdfmeat at https://code.google.com/p/pdfmeat/ which as of > one year ago includes a stand-alone CLI python script to generate BibTeX > entries given a file. To get it working on OS X I had to change the path for > the FireFox cookie file from ~/mozilla/firefox/ to ~/Library/Application > Support/FireFox/Profiles/, did "pip install X" for each X it complained was > missing, and it "just worked". Nice. > > It seems like this could be wrapped in a plugin so that drag-and-dropping PDF > files onto BibDesk could auto-import with meta-data, just like Mendely and > Papers and Zotero and all the other PDF/bibliography managers. > > I searched for "pdfmeat" and "bibdesk" and found almost no hits. Is anyone > aware of such a plugin, or anyone familiar with plugin writing un-aware of > pdfmeat and now interested in creating this plugin? If not, I may have to > figure out how BibDesk plugins work... > > -k. > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk_______________________________________________ > Bibdesk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bibdesk-users > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > Bibdesk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bibdesk-users ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
