Set to current application's NSJSONSerialization's JSONObjectWithData:theData options:0 |error|:(reference) Set theData to str's dataUsingEncoding:(current application's NSUTF8StringEncoding) Set str to current application's NSString's stringWithString:zotext_result Here’s her revision: use scripting additions URLs of the form zotero://select/library/items/id seem to work fine. For URL zotero://select/items/id, opening it only opens Zotero window, it does not select the right entry. This will make sure the ID and title are from the same item when there are multiple selections, though it rarely happens.Ĭhange URL zotero://select/items/id to zotero://select/library/items/id. Get item ID and item title from the same entity of JSON response. If We use delimiter quote to break text apart to get title value, it will have problem if title itself contains a quote. To quote our dev who did the work:Ĭonvert JSON string to JSON object using AppleScriptObj-C, so we can correctly retrieve the title value. We’d love to get some feedback from you or another Zotero user regarding the changes. Thanks again, made some changes to the proposed Zotero script. Set newText2 to text items of item 2 of newText Set AppleScript's text item delimiters to "\"" Set newText to text items of zotext_result Set AppleScript's text item delimiters to "\"title\"" Set zotext_result to do shell script "curl -s -d selected=t\\&format=json -G " Set link to "zotero://select/items/" & item 2 of theTextItems Set theTextItems to every text item of zotext_result Set AppleScript's text item delimiters to quote set zotext_result to do shell script "curl -s -d selected=t\\&format=key -G " Also it would be useful for other Zotero users to test. It works for me, but I was hoping that someone who actually knows AppleScript could provide comments (especially the kludge to get the title field from the response). The GetAddress script queries the inbuilt webserver of Zotero via the API that zotxt exposes twice to get the key of the selected item and then the title of the selected item, and then forms a markdown link for them. If you see a Window listing your Zotero library, enter any necessary information in the boxes at the bottom of the window, then click OK.I appear to have Zotero working with Hook, with the caveat that you need to install the ‘zotxt’ plugin for Zotero. Hit enter to accept the changes, then hit enter again to insert them. If you see a Red Search Bar, click on the reference you need to edit, and then enter any necessary information in the popup that appears. This will bring up the insert citation dialog you saw when inserting the citation. Now, from the Zotero tools menu in Word, select the button or menu item for Add/Edit Citation or Zotero Edit Citation. The citation should become highlighted in gray-this means you're ready to edit. To do this, click within the text of the citation (or the footnote, depending on the style you're using). You may occasionally need to edit a citation you inserted with Zotero-to add page numbers, prefix or suffix information, or to omit the author's name, for example. Zotero will add the citation at your cursor. If you see a Window listing your Zotero library, search or browse for the reference you want to cite, select it from the list, and then click OK. If you see a Red Search Bar, search for and select the reference you want to cite, press Enter to select it, and then Enter again to insert it. Zotero will add the citation at your cursor. Then, you'll see that the insert citation dialog appears it's either a red search bar or a small window with your Zotero library, depending on your setup. If this is your first citaiton in the document, you'll first need to select your desired citation style from the document preferences window that appears. To add a citation, look for a button or menu item that says Add/Edit Citation or Zotero Insert Citation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |