On Jan 25, 2014, at 3:11, Ken Mankoff wrote:

> Ok, it seems there is no mechanism to parse the raw BibTeX record (it is 
> read-only in BibDesk AppleScript).
> 
> I guess a simple work-around is to import an entirely new record using the 
> pdfmeat.py output, link the old file (the file link being the only thing in 
> the previous empty record) to the new record, and then delete the old record.
> 
> I have the import working, and know how to delete a record thanks to the 
> sample script, but can't figure out how to move the linked file from the old 
> to the new.
> 
>    -k.
> 
> 
> 
> 
> 
> On Fri, Jan 24, 2014 at 8:11 PM, Ken Mankoff <[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.

It is probably easier to copy the fields from the (temporary) new item you get 
from pdfmeat to the old item. If they're always the same fields, you could go 
over those fields explicitly. Or you could loop over the fields of the 
temporary item.  I do something like that in my BibDesk Download script 
available on the Wiki.

Christiaan

> 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]> 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

Reply via email to