zotpick-applescript icon indicating copy to clipboard operation
zotpick-applescript copied to clipboard

Zotpick has started entering citations in all-caps

Open sjkiss opened this issue 3 years ago • 1 comments

HI there: Somehow, zotpick is entering citations in all caps in my markdown documents (e.g. Typora) and in other documents that I tested (e.g. Word) and right here: @KOOPGRASSROOTSLIBERALSORGANIZING2011.

This is a brand-new behaviour and I'm at a bit of a loss. Running Zotero 5.0.96.3 and Better Bibtex for Zotero 6.1.5. It's possible I guess that better bibtex got updated and this is responsible? Not sure.

tell application "System Events"
	try
		set appName to (the name of every process whose frontmost is true) as string
	on error errMsg
		display alert "Problem" message "Could not get the name of the frontmost application."
		error number -128
	end try
end tell
set zotRunning to do shell script "/usr/bin/curl 'http://localhost:23119/better-bibtex/cayw?probe=probe' 2>/dev/null; exit 0"
if zotRunning is "" then
	display alert "Zotero not running" message "This script will not work unless Zotero is running. Please launch Zotero and try again"
	tell application appName
		activate
	end tell
	error number -128
else if zotRunning is "No endpoint found" then
	display alert "Better BibTeX not installed" message "This script will not work unless Better BibTeX is installed. Please make sure that Better BibTeX is installed in the running instance of Zotero"
	tell application appName
		activate
	end tell
	error number -128
else if zotRunning is "ready" then
	set theReference to do shell script "/usr/bin/curl 'http://localhost:23119/better-bibtex/cayw?format=pandoc' 2>/dev/null; exit 0"
	try
		repeat until application appName is frontmost
			tell application appName to activate
		end repeat
	on error errMsg
		display alert errMsg
	end try
	tell application "System Events"
		try
			keystroke theReference
		on error errMsg
			display alert errMsg
		end try
	end tell
end if

sjkiss avatar Jan 18 '22 19:01 sjkiss

I don't see it with Zotero 5.0.96.3 and BBT 6.1.5 or 6.1.7. That last is a recent update, so maybe try that first?

You can use the command line to see what Zotero returns by trying:

curl http://localhost:23119/better-bibtex/cayw?format=pandoc 2>/dev/null

Zotpick doesn't really do anything what that string except type it. Any chance you've got caps lock on? 😄

Jmuccigr avatar Jan 19 '22 23:01 Jmuccigr