Dear Ken,
On 25/01/2014, at 03:11 , Ken Mankoff wrote:
Ok, it seems there is no mechanism to parse the raw BibTeX record (it is
read-only in BibDesk AppleScript).
Of course not. You can fully read and write BibDesk records using AppleScripts.
It is however, not fully clear what you mean by raw BibTeX record. What I know
is that you should not meddle with those and leave that to BibDesk to manage
the data in the bib file. Otherwise you risk getting a huge mess.
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.
There are plenty of example AppleScripts within the BibDesk community which can
do what you seem to be looking for. Why don't you have a look at those ("Help
-> Visit BibDesk Wiki")? Here a link to mine I offer from this web site:
http://www.sysecol.ethz.ch/people/afischli Link Software -> BibDesk ->
AppleScripts
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.
see above
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