Skip to content

{ Category Archives } Chickenfoot

copying to clipboard Zotero citations as HTML w/ chickenfoot

Here's a first pass at a Chickenfoot script that copies selected Zotero items as HTML to the clipboard.  (I couldn't find anything in the Zotero interface to do exactly this function.  There is a  Create Bibliography from Selected Item(s)->Copy to Clipboard but that seems to copy citations as RTF for me.) var Zotero = chromeWindow.Zotero; […]

Tagged ,

Range of creator types in Zotero

One thing that I didn't know about Zotero was the range of creator types in Zotero. Here's a Chickenfoot script that you can run to list them: // to explore the range of creatorTypes // to do: figure out how to get localized string for different creator types var Zotero = chromeWindow.Zotero; var creatorTypes = […]

Tagged ,

Accessing attributes of Zotero Items

The following Chickenfoot script demonstrates how to access attributes related to Zotero items. (I've run this script on both Zotero 1.0.7 and the latest named release of  Zotero 1.5 Sync Preview (1.5-sync3.5))): // zotero_item_show_pieces.js // code to extract elements of the first selected item // Dec 16, 2008 var Zotero = chromeWindow.Zotero; var ZoteroPane = […]

Tagged ,

Adding all tabs to Zotero Version 2 — scraping translatable sites

In a previous post adding all Firefox tabs to Zotero using Chickenfoot, I showed how to write a Chickenfoot script to loop through all Firefox  tabs and add each of them as an item into Zotero.  A limitation of the script was that it used only ZoteroPane.addItemFromPage for every tab, even if a given tab […]

Getting primary and secondary item types in Zotero

A Chickenfoot script for calculating the primary and secondary Zotero items (which draws upon the code in overlay.js->onLoad(): // based on https://www.zotero.org/trac/browser/extension/tags/1.0.7/chrome/content/zotero/overlay.js#L153 var Zotero = chromeWindow.Zotero; var itemTypes = Zotero.ItemTypes.getPrimaryTypes(); for(var i = 0; i<itemTypes.length; i++) { output (itemTypes[i]['name'] + ":" + itemTypes[i]['id']); } var itemTypes = Zotero.ItemTypes.getSecondaryTypes(); for(var i = 0; i<itemTypes.length; i++) { output (itemTypes[i]['name'] + ":" + itemTypes[i]['id']); } The output of the script is (for […]

Tagged ,

A screencast to show Chickenfoot scripting of Zotero

Several weeks ago, I wrote (a blog post and a post on the zotero-dev group) on how to use Chickenfoot to script Zotero. I'm starting to experiment with creating little videos that I hope will make my technical posts easier to understand. Here's one I just made to illustrate what I wrote about in the […]

Tagged , ,

adding all Firefox tabs to Zotero using Chickenfoot

We can now build on what was presented in the previous blog post: Adding items to Zotero with Chickenfoot. The end goal is to loop through all the tabs and add Each of them as items into Zotero. So we need to figure out how to access the tabs. I would do so here by […]

Tagged ,

Adding items to Zotero with Chickenfoot

Here I report a few code fragments that you can try in Chickenfoot to create a Zotero item from the contents in the selected tab of your browser. (For a bit of context for what I'm talking about here, see my previous post Data Unbound » Accessing Zotero via Chickenfoot: a warm up exercise.) There's […]

Tagged ,

Listing the URLs of all my current Firefox tabs using Chickenfoot

Here's some code I figured out for doing so that I believe should work: var tabBrowser = getTabBrowser(chromeWindow); var tabs = tabBrowser.mTabBox._tabs.childNodes; for (var i=0; i <tabs.length; i++) { var browser = tabBrowser.getBrowserForTab(tabs[i]); output(browser.contentWindow.location); } It took me a while to gather the pieces, and I'll have to explain how I did it — but […]

Tagged