> On 29 Nov 2020, at 19:53, Matthew Heun via Bibdesk-users > <[email protected]> wrote: > > This is exciting! Thanks Christiaan! > > I have two questions. > > * At > https://hookproductivity.com/help/integration/creating-integration-scripts/ > <https://hookproductivity.com/help/integration/creating-integration-scripts/>, > it says that "A document must always produce the same URL even if the > document is moved renamed or edited." The script below will not meet that > requirement if the cite key changes. Should we rather use the DOI of an > entry as the primary URL, if the DOI is present? (The scheme you suggested > (using the cite key) could be a backup scheme when no DOI is present.)
That requirement cannot be met. I fact it is a very strong requirement. Looking up by cite key is the only thing that can be done, that is supported (see also below). If they really need an unchanged identifier, then Hook is simply not suitable for BibDesk. > * At present, the script below works when a BibTeX entry is the frontmost > window. Could the script be made to work when the .bib window is the > frontmost window and a single row of the .bib file is selected? (If no row > of the .bib file is selected, it seems that the entire .bib file should be > linked. In fact, that is the current behavior. Yay!) That’s exactly what it does. It first looks at the front most detail editor for a publication, if that is not present it looks at a single selected publication, and if there is no single item selected, it defaults to the whole bibliography. > * Should the URL returned by this script also encode an identifier for the > .bib file in which the entry is embedded? It seems like Hook will need to > know which .bib file to open before finding the entry within that .bib file. > For Spotlight support we already maintain a way to find the database file for a cite key, so that information is implicit. > * If a .pdf is selected in the BibDesk UI, would it be possible to return a > URL for that file in the OS? I am not sure whether that is the purpose of Hook. It would not open in BibDesk. Apart from that, it is not possible to figure out with AppleScript whether a linked file is selected in the UI, and which selection would you want to use? > There are a couple additional steps to complete Hook integration, but we are > already getting close! I think I could write the scripts below, after we > finalize the URL scheme. > > * Another required script is an Open Item script, which will need to parse a > URL and open that entry in the BibTeX file. The Open Item would possibly > first open the .bib file then open the linked entry within that file. I understand from their web site that opening is already handled by default, it does not require a separate script. BibDesk already can directly open the URLs returned by the script, and the system should know about that. > * The final (optional) script is a New Item script. I think I could write > that one that invokes the New Publication item from the Publication menu. I have no idea what the input data is. So I also would not know how to create an item from that. And creating an (almost) empty item would not work properly, as it would not have a cite key yet, so the returned URL would not be correct. > Thanks for the quick work, Christiaan. I'm eager to hear your thoughts on my > questions above. > > Cheers, > > Matt Christiaan >> sorry, there was an error in that script. Here’s the corrected one: >> >> >> tell application "BibDesk" >> set the_pub to publication of front window >> tell front document >> if the_pub is missing value then >> set the_pubs to its selection >> if count the_pubs is 1 then >> set the_pub to get item 1 of the_pubs >> end if >> end if >> if the_pub is not missing value then >> set the_name to title of the_pub >> set the_url to export using text >> "<[email protected]/>" for the_pub >> else >> set the_name to its name >> set the_url to file URL of its file >> end if >> end tell >> return "[" & the_name & "](" & the_url & ")" >> end tell >> >> >> Christiaan >> >> _______________________________________________ >> Bibdesk-users mailing list >> [email protected] >> <mailto:[email protected]> >> https://lists.sourceforge.net/lists/listinfo/bibdesk-users > > _______________________________________________ > Bibdesk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bibdesk-users Christiaan
_______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
