{"action":"created","issue":{"url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/619","repository_url":"https://api.github.com/repos/retorquere/zotero-better-bibtex","labels_url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/619/labels{/name}","comments_url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/619/comments","events_url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/619/events","html_url":"https://github.com/retorquere/zotero-better-bibtex/issues/619","id":197638366,"number":619,"title":"[question] postfix script on the citekey?","user":{"login":"ookimi","id":1450322,"avatar_url":"https://avatars.githubusercontent.com/u/1450322?v=3","gravatar_id":"","url":"https://api.github.com/users/ookimi","html_url":"https://github.com/ookimi","followers_url":"https://api.github.com/users/ookimi/followers","following_url":"https://api.github.com/users/ookimi/following{/other_user}","gists_url":"https://api.github.com/users/ookimi/gists{/gist_id}","starred_url":"https://api.github.com/users/ookimi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ookimi/subscriptions","organizations_url":"https://api.github.com/users/ookimi/orgs","repos_url":"https://api.github.com/users/ookimi/repos","events_url":"https://api.github.com/users/ookimi/events{/privacy}","received_events_url":"https://api.github.com/users/ookimi/received_events","type":"User","site_admin":false},"labels":[{"id":231666162,"url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/labels/question","name":"question","color":"006b75","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-27T03:06:25Z","updated_at":"2016-12-27T13:12:26Z","closed_at":null,"body":"I am trying to run a postfix script with simple search-and-replace on the generated bibtex citation key - but for the love of God I can't find how to access it.\r\nI would have guessed \"this.item.citekey\" - but this pattern doesn't work:\r\n\r\nthis.item.citekey.replace('a', 'b');\r\n"},"comment":{"url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/comments/269324104","html_url":"https://github.com/retorquere/zotero-better-bibtex/issues/619#issuecomment-269324104","issue_url":"https://api.github.com/repos/retorquere/zotero-better-bibtex/issues/619","id":269324104,"user":{"login":"retorquere","id":132108,"avatar_url":"https://avatars.githubusercontent.com/u/132108?v=3","gravatar_id":"","url":"https://api.github.com/users/retorquere","html_url":"https://github.com/retorquere","followers_url":"https://api.github.com/users/retorquere/followers","following_url":"https://api.github.com/users/retorquere/following{/other_user}","gists_url":"https://api.github.com/users/retorquere/gists{/gist_id}","starred_url":"https://api.github.com/users/retorquere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retorquere/subscriptions","organizations_url":"https://api.github.com/users/retorquere/orgs","repos_url":"https://api.github.com/users/retorquere/repos","events_url":"https://api.github.com/users/retorquere/events{/privacy}","received_events_url":"https://api.github.com/users/retorquere/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T13:12:26Z","updated_at":"2016-12-27T13:12:26Z","body":"No magic setting, no... I'd have to think about this one. `nopunct` removes the `punctuation` character class as defined by the unicode spec, which includes `punctuation-dash`. \r\n\r\nHaving \r\n\r\n```\r\nvar re = Zotero.Utilities.XRegExp('\\\\p{Pc}|\\\\p{Pe}|\\\\p{Pf}|\\\\p{Pi}|\\\\p{Po}|\\\\p{Ps}', 'g')\r\nthis.item.__citekey__  = Zotero.Utilities.XRegExp.replace(this.item.__citekey__, re, '', 'all')\r\n```\r\n\r\nmight do what you want... but again, I'd have to dive into the caching system to make sure that doesn't give wacky results elsewhere. I think not, as what I'm seeing so far caches the citekey but doesn't use it as a lookup key, and as the citekey is not guaranteed unique (legitimate duplicates may exist across libraries, and if you pin citekeys I don't prevent you from pinning duplicates) it really shouldn't, but I'm not 100% sure. Except of course you won't see it in the UI, and the Quick Copy settings don't run the postscript, which affects key drag-and-drop.\r\n\r\nI'm trying to think of a way that works everywhere but doesn't lead to a (further) proliferation of preferences."}}
{"actor":{"display_login":"retorquere"}}