Jump to content
schoeps

Search Bibdesk library

Recommended Posts

Hey,

 

many people here seem to be interested in searching (academic) publications, see e.g. jstor, pubmed. I have written a simple workflow that searches your local BibDesk library based on Spotlight. This makes finding your PDFs much easier :)

 

Download here: BibDesk_Search.alfredworkflow or via alfpt

 

Bye

Sebastian

 

Update 2013-03-25: Recent Version is 2.1 (see thread below)

Edited by Sebastian

Share this post


Link to post

This workflow is awesome, it was a major reason for me to make the switch from LaunchBar to Alfred, thanks, Sebastian!

 

I have two requests:

 

1. Could you maybe put the publication year into the output? Maybe instead of the "Authors: " in the beginning of the second line?! That would help me a lot, as I often know an author and year, but not the exact title...

 

2. Related: Could you maybe adapt the search so that the year field is searched also? When I search for "author somewordfromtitle", I get the result I want, when I search for "author year", I do not get anything...

 

Thanks for your great work!

Share this post


Link to post

This workflow is awesome, it was a major reason for me to make the switch from LaunchBar to Alfred, thanks, Sebastian!

 

I have two requests:

 

1. Could you maybe put the publication year into the output? Maybe instead of the "Authors: " in the beginning of the second line?! That would help me a lot, as I often know an author and year, but not the exact title...

 

2. Related: Could you maybe adapt the search so that the year field is searched also? When I search for "author somewordfromtitle", I get the result I want, when I search for "author year", I do not get anything...

 

Thanks for your great work!

 

Dear Januz,

 

I incorporated your ideas. Please get the new version (1.3) here:

 

BibDesk_Search.alfredworkflow

 

and let me know how it works. I have put the date info to the end of the subtitle string but I think that you can live with it. 

 

Bye

Sebastian

Share this post


Link to post

Hi Sebastian,

 

great, thank you very much! Strangely, with the new version, most of the time, the search results are displayed only for a second or so and are then replaced by the default options ("Search Google for 'bib searchterm'" etc.). The new features seem to work though (year is displayed and searching for an author and a year works, before the results vanish...).

 

Thanks,

 

J

Share this post


Link to post

... yes, it did. Thanks again!

 

Regarding the placement of the year: Sadly, when the number of authors is high (not uncommon in my field), the year is not displayed, because it is displayed on the right side. Would you maybe consider displaying it on the left side like in this Pubmed workflow: http://www.alfredforum.com/topic/478-pubmed-searches/?p=2384 (e.g., "2013: Author1, Author2, etc")?

 

Best,

 

J

Share this post


Link to post

... yes, it did. Thanks again!

 

Regarding the placement of the year: Sadly, when the number of authors is high (not uncommon in my field), the year is not displayed, because it is displayed on the right side. Would you maybe consider displaying it on the left side like in this Pubmed workflow: http://www.alfredforum.com/topic/478-pubmed-searches/?p=2384 (e.g., "2013: Author1, Author2, etc")?

 

Best,

 

J

In my field of science you have only a few authors. Anyway, new version 1.4 :)

 

Bye, Sebastian

Share this post


Link to post

In my field of science you have only a few authors.

Yeah, this seems to vary a lot from discipline to discipline...

 

Anyway, new version 1.4

You're the best, thank you very much!!

 

Best,

 

J

Share this post


Link to post

Hey Sebastian,

 

thanks again for the great workflow, I am using it almost every day!

 

One little thing I miss, though, is the ability to search with an exact BibTeX key (e.g. "bib WimmerMayringerEtAl1999"). When I do this, the workflow does not recognize the entry. I use this often to go back from LaTeX to the cited article, i.e. select BibTeX key in \cite{} command, press Modifier to send text to Alfred (via Show Alfred with selection workflow), type in bib and jump to the file in BibDesk.

 

At the moment, I am doing this via AppleScript, but it would be great if you could modify your workflow to search also the keys?!

 

Thanks,

 

J

Share this post


Link to post

Hi,

 

it should be fixed in 1.5, i.e., "bib xxx" searches the keys too. Maybe I will think in the future about specific keywords like "bibkey WimmerMayringerEtAl1999" to allow more precise search… well let's see :)

 

Bye

Seb.

  

One little thing I miss, though, is the ability to search with an exact BibTeX key (e.g. "bib WimmerMayringerEtAl1999"). When I do this, the workflow does not recognize the entry. I use this often to go back from LaTeX to the cited article, i.e. select BibTeX key in \cite{} command, press Modifier to send text to Alfred (via Show Alfred with selection workflow), type in bib and jump to the file in BibDesk.

 

Edited by Sebastian

Share this post


Link to post

Hi

This has stopped working for me for some reason.  I type bib & get the Search in Bibdesk library... prompt in Alfred, select it and start typing, then Alfred immediately bumps me to the default Google search for "bib " & whatever I typed.

 

If I manually run search.php in Terminal, it outputs the correct results, XML formatted.  

 

Any ideas?

thanks

Derick

Share this post


Link to post

I think I have made some progress figuring out what is up.  When I tried the search, that wasn't working in Alfred, in Terminal, I got the result 

 

Warning: SimpleXMLElement::addChild(): unterminated entity reference

above the XML output.

 

Other searches work.  

 

The problem search had "\&" in the Title field of one of the publications.  When I replaced that with the word "and" , Alfred went back to finding the results successfully, and the search didn't give the warning when running search.php directly in Terminal.

Edited by dfay

Share this post


Link to post

The problem should be fixed in the latest version (1.6). I had to employ some very strange encoding tricks. Bye, Sebastian

Edited by Sebastian

Share this post


Link to post

This still doen't work here. When I type "bib", Alfred offers me to "Search in BibDesk library", but as soon as I type the search argument, only the default search engines are displayed. Too bad, I'd really love to use this workflow...

Edited by miq

Share this post


Link to post

This still doen't work here. When I type "bib", Alfred offers me to "Search in BibDesk library", but as soon as I type the search argument, only the default search engines are displayed. Too bad, I'd really love to use this workflow...

OK, let's try to find out what the problem is:

1. what is the content of the directory 

~/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/

There should be plenty of files ("*.bdskchache").

 

2. open terminal.app and go to the directory of the bibdesk plugin (you can find out the location by opening the workflow tab of the preferences, then right click on bibdesk workflow and click open in finder). Enter in terminal: 

php search.php author

What is the output?

Share this post


Link to post

Sebastian, thank you for your reply!

 

1.

The folder does not exist. I only find ~/Library/Caches/edu.ucsd.cs.mmccrack.bibdesk/ containig no .bdskcache files at all.

 

2.

Maybe this is related, but I get no output, but also no error, just a new line ending with $.

 

This might rather be a BibDesk problem?

Thanks for your help!

Share this post


Link to post

You have a ".bib"-file somewhere that contains your library, right? Then you need to open it with bibdesk and then save it. The reason is that Bibdesk creates .bdskcache whenever it saves a bib-file. Afterwards they should be visible to Alfred.

 

The folder does not exist. I only find ~/Library/Caches/edu.ucsd.cs.mmccrack.bibdesk/ containig no .bdskcache files at all.

 

This might rather be a BibDesk problem?

Thanks for your help!

Share this post


Link to post

Now I have the files in ~/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/. I think, in the BibDesk I had to enable "automatic backups". That's the good news. The bad: It still doesn't work.

 

Terminal now gives the output:

 

"<?xml version="1.0"?>

<items><item uid="bib/Users/miq/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Fish:1980.bdskcache" arg="/Users/miq/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Fish:1980.bdskcache"><title>Is there a Text in this Class? The Authority of Interpretive Communities</title><subtitle>1980: Fish, Stanley</subtitle><icon>icon.png</icon></item></items>"

 

But still, Alfred behaves as described above.

Share this post


Link to post

The output is perfect and since the main work of the plugin is done exactly in this php script I is difficult to debug beyond this point. However, do you use Mavericks? I realized that search results come sometimes with some delay. I will try to find out why...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×