Ken Mankoff's scripts help

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ken Mankoff's scripts help

Jan David Hauck
Hi all,

I'm trying out Ken Mankoff's import scripts from
https://github.com/mankoff/BibDeskAppleScripts
but get a python error message for pdfmeat (bibfetch working fine)
(I did install all the modules it asked for)
Errno 2: No such file or directory

Traceback (most recent call last):
  File "/usr/local/pdfmeat/pdfmeat.py", line 580, in <module>
    main()
  File "/usr/local/pdfmeat/pdfmeat.py", line 565, in main
    pf.processFile()
  File "/usr/local/pdfmeat/pdfmeat.py", line 318, in processFile
    p = self.pdfToText(['-enc','UTF-8'])
  File "/usr/local/pdfmeat/pdfmeat.py", line 88, in pdfToText
    proc = subprocess.Popen(commando_pdf2txt, stdout=subprocess.PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Anyone any ideas what the problem could be here? 
All help greatly appreciated!
J

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ken Mankoff's scripts help

Ken Mankoff
Hi Jan,

See the last thread to this list posted last week. I no longer use pdfmeat and have a slightly different set of scripts: http://comments.gmane.org/gmane.comp.tex.bibtex.bibdesk.user/7210

If you want to stick with that setup... I didn't write pdfmeat and don't know what the error is below, but the key phrase seems to be addressed here: https://github.com/mankoff/BibDeskAppleScripts/issues/1

  -k.


On 2016-02-16 at 18:45, Jan David Hauck <[hidden email]> wrote:

> Hi all,
>
> I'm trying out Ken Mankoff's import scripts from
> https://github.com/mankoff/BibDeskAppleScripts
> but get a python error message for pdfmeat (bibfetch working fine)
> (I did install all the modules it asked for)
> Errno 2: No such file or directory
>
> Traceback (most recent call last):
>   File "/usr/local/pdfmeat/pdfmeat.py", line 580, in <module>
>     main()
>   File "/usr/local/pdfmeat/pdfmeat.py", line 565, in main
>     pf.processFile()
>   File "/usr/local/pdfmeat/pdfmeat.py", line 318, in processFile
>     p = self.pdfToText(['-enc','UTF-8'])
>   File "/usr/local/pdfmeat/pdfmeat.py", line 88, in pdfToText
>     proc = subprocess.Popen(commando_pdf2txt, stdout=subprocess.PIPE)
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
> line 710, in __init__
>     errread, errwrite)
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
> line 1335, in _execute_child
>     raise child_exception
> OSError: [Errno 2] No such file or directory
>
> Anyone any ideas what the problem could be here?
> All help greatly appreciated!
> J
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ken Mankoff's scripts help

Jan David Hauck
Thank you Ken!

That hint on your github page got the old version working (pdftottext was missing).
So pdfmeat works fine now for populating the fields. 
The only problem is that every time it also tries to open a google scholar and an academia.edu page in the browser.  Any idea how to get rid of that behavior?

I also installed the new version that you posted on the list, but it works only partly:

When the DOI Field is already present, it gets the other fields, but I always shows a dialog box before it runs, with:
cd /tmp;  /usr/bin/python /usr/local/bin/doi2bib.py "10.1111/j.1548-1395.2012.01134.x"  | /usr/bin/iconv -c
When I hit OK it works fine.  Any way how to avoid that? 

If DOI is not present, I was unable to extract the doi from the pdf.
It shows the following dialog:
  /usr/bin/python /usr/local/bin/doi_from_pdf.py /Users/jdh/Google Drive/Academic Papers Import/A R T I C L E S   &   B O O K S/ * 1st Lg Meta-Aware */First Language-2005-Farrar-157-72.pdf  | /usr/bin/iconv -c

And then the dialog box to manually enter the DOI pops up, so it looks like it doesn't try to extract it from the PDF.  Running doi_from_pdf.py from the command line I get:
  File "/usr/local/bin/doi_from_pdf.py", line 8, in <module>
    pdf_file = sys.argv[1]
IndexError: list index out of range
I assume that's part of the problem?

Any help greatly appreciated.
Jan




On Wed, Feb 17, 2016 at 6:40 AM, Ken Mankoff <[hidden email]> wrote:
Hi Jan,

See the last thread to this list posted last week. I no longer use pdfmeat and have a slightly different set of scripts: http://comments.gmane.org/gmane.comp.tex.bibtex.bibdesk.user/7210

If you want to stick with that setup... I didn't write pdfmeat and don't know what the error is below, but the key phrase seems to be addressed here: https://github.com/mankoff/BibDeskAppleScripts/issues/1

  -k.


On 2016-02-16 at 18:45, Jan David Hauck <[hidden email]> wrote:
> Hi all,
>
> I'm trying out Ken Mankoff's import scripts from
> https://github.com/mankoff/BibDeskAppleScripts
> but get a python error message for pdfmeat (bibfetch working fine)
> (I did install all the modules it asked for)
> Errno 2: No such file or directory
>
> Traceback (most recent call last):
>   File "/usr/local/pdfmeat/pdfmeat.py", line 580, in <module>
>     main()
>   File "/usr/local/pdfmeat/pdfmeat.py", line 565, in main
>     pf.processFile()
>   File "/usr/local/pdfmeat/pdfmeat.py", line 318, in processFile
>     p = self.pdfToText(['-enc','UTF-8'])
>   File "/usr/local/pdfmeat/pdfmeat.py", line 88, in pdfToText
>     proc = subprocess.Popen(commando_pdf2txt, stdout=subprocess.PIPE)
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
> line 710, in __init__
>     errread, errwrite)
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
> line 1335, in _execute_child
>     raise child_exception
> OSError: [Errno 2] No such file or directory
>
> Anyone any ideas what the problem could be here?
> All help greatly appreciated!
> J
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________
> Bibdesk-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ken Mankoff's scripts help

Ken Mankoff

On 2016-02-16 at 22:18, Jan David Hauck <[hidden email]> wrote:
> The only problem is that every time it also tries to open a google
> scholar and an academia.edu page in the browser. Any idea how to get
> rid of that behavior?

I have some vague recollection that it uses either Firefox or your default browser as a proxy, and you need to manually go to those pages and make sure cookies are accepted or something. But I can't recall any details.

> When the DOI Field is already present, it gets the other fields, but I
> always shows a dialog box before it runs, with:
> cd /tmp;  /usr/bin/python /usr/local/bin/doi2bib.py
> "10.1111/j.1548-1395.2012.01134.x"  | /usr/bin/iconv -c
> When I hit OK it works fine.  Any way how to avoid that?

Comment out the line in the AppleScript that prints that message.

> If DOI is not present, I was unable to extract the doi from the pdf.

DOI extraction only works on some PDFs.

> It shows the following dialog:
>   /usr/bin/python /usr/local/bin/doi_from_pdf.py /Users/jdh/Google
> Drive/Academic Papers Import/A R T I C L E S   &   B O O K S/ * 1st Lg
> Meta-Aware */First Language-2005-Farrar-157-72.pdf  | /usr/bin/iconv -c

Spaces in path names are likely to cause problems. You could update the script so that it wraps the path/to/file in quotes.

> And then the dialog box to manually enter the DOI pops up, so it looks like
> it doesn't try to extract it from the PDF.  Running doi_from_pdf.py from
> the command line I get:
>   File "/usr/local/bin/doi_from_pdf.py", line 8, in <module>
>     pdf_file = sys.argv[1]
> IndexError: list index out of range
> I assume that's part of the problem?

Try putting ""'s around the file.

  -k.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ken Mankoff's scripts help

Jan David Hauck
Hi Ken,

Thanks for your hints. 
I figured it out:  Your doi_from_pdf.py script still had the line:
pdf_file = "/Users/mankoff/Documents/Papers/M/Mankoff/Mankoff_2013_The_Kinect_a_low-cost,.pdf"
I got rid of that and now works fine.
Thanks so much for such an awesome script/workflow!
(And for being so quick in responding!)

J



On Wed, Feb 17, 2016 at 10:33 AM, Ken Mankoff <[hidden email]> wrote:

On 2016-02-16 at 22:18, Jan David Hauck <[hidden email]> wrote:
> The only problem is that every time it also tries to open a google
> scholar and an academia.edu page in the browser. Any idea how to get
> rid of that behavior?

I have some vague recollection that it uses either Firefox or your default browser as a proxy, and you need to manually go to those pages and make sure cookies are accepted or something. But I can't recall any details.

> When the DOI Field is already present, it gets the other fields, but I
> always shows a dialog box before it runs, with:
> cd /tmp;  /usr/bin/python /usr/local/bin/doi2bib.py
> "10.1111/j.1548-1395.2012.01134.x"  | /usr/bin/iconv -c
> When I hit OK it works fine.  Any way how to avoid that?

Comment out the line in the AppleScript that prints that message.

> If DOI is not present, I was unable to extract the doi from the pdf.

DOI extraction only works on some PDFs.

> It shows the following dialog:
>   /usr/bin/python /usr/local/bin/doi_from_pdf.py /Users/jdh/Google
> Drive/Academic Papers Import/A R T I C L E S   &   B O O K S/ * 1st Lg
> Meta-Aware */First Language-2005-Farrar-157-72.pdf  | /usr/bin/iconv -c

Spaces in path names are likely to cause problems. You could update the script so that it wraps the path/to/file in quotes.

> And then the dialog box to manually enter the DOI pops up, so it looks like
> it doesn't try to extract it from the PDF.  Running doi_from_pdf.py from
> the command line I get:
>   File "/usr/local/bin/doi_from_pdf.py", line 8, in <module>
>     pdf_file = sys.argv[1]
> IndexError: list index out of range
> I assume that's part of the problem?

Try putting ""'s around the file.

  -k.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bibdesk-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users
Loading...