[Share] copy zotero markdown link with citation info/复制作者-年份引用markdown条目链接 #405
littleironx
started this conversation in
Action Scripts
Replies: 2 comments
-
There could be another solution with Better Bibtex: /**
* Create a Markdown link with Citation Key (Better BibTeX)
* Example: `[Author (year)](zotero://select/items/@citationKey)`
* Use the item pane header (in Zotero 7) as the text for the hyperlink.
*/
if (items?.length > 0) {
// Do something with all selected items
return "Please select one item instead.";
}
let citationKey = item.getField('citationKey'); // Replace 'citationKey'
// use item pane header as the text
let doc = Zotero.getActiveZoteroPane().document;
let creatorYearText = doc.querySelector('item-pane-header .creator-year').textContent
// Combine the strings
let result = `[` + creatorYearText + `](zotero://select/items/@` + citationKey + `)`
Zotero.Utilities.Internal.copyTextToClipboard(result)
return "Markdown link copied."; |
Beta Was this translation helpful? Give feedback.
0 replies
-
if anyone prefer the form ""LastNameoftheFirstAuthor"-2024-"NameoftheItem"", please try the following code I modified.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
modify based on Copy Zotero link
this script can generate a markdown link with citation infomation such as A&B(2024)[zotero://select]
Event
None
Operation
None
Data
Anything else
No response
Beta Was this translation helpful? Give feedback.
All reactions