Hacked By Anonymous

UnitedSecTeam

Pesting since 2015

@UnitedSecAnon

Well, I’ve delved into Applescript and have the following code to retrieve the citation marker.

/tell application "EndNote X5"
	activate
	tell application "System Events"
		tell process "Endnote X5"
			keystroke "c" using [command down]
		end tell
	end tell
end tell

Now I’m looking for a way to insert the reference into the document created by choosing “Reference from EndNote X4”

Does anyone have any thoughts on how to achieve this?

Jeff

In ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex reveal the package contents of Reference (from EndNote X4).templatescriptd. Inside that package look into the localization folder you want to work with and modify Reference.rtf. Also modify the script in Contents/Resources/Scripts/main.scpt

Those are the things that need to be changed. Sorry to be terse, but it’s not simple, as this is one of the most complex template scripts out there and Endnote’s support for AppleScript is minimal. (I don’t see a field in their AppleScript dictionary for citation marker, but that doesn’t mean there isn’t another way.) If you’re not comfortable with some fairly advanced scripting, you might want to submit a feature request or find another workaround. directly to DEVONtech.

Well I’ve stapled a solution together that works just fine.

I’ve modified the Endnote X4 .rtf template by adding a placeholder titled "%CitationRef% in a new row in the template.

I then added the script below to the beginning of the ecript to get the CitationRef ({Stuttaford, 1999 #69} for example).

-- Smart template adding the selected EndNote citation to DEVONthink
-- Written by Eric Böhnisch-Volkmann
-- © 2009 DEVONtechnologies, LLC

----- NEW SCRIPT ADDITION -----
-- gets the Citation reference from the 
-- reference selected in the open
-- EndNote window

tell application "EndNote X5"
	activate
	tell application "System Events"
		tell process "Endnote X5"
			keystroke "c" using [command down]
		end tell
	end tell
end tell

I then modified the Applescript further down the page by adding the following line code modified from the entry above it.

if text of theParagraph contains "%citationYear%" then set text of theParagraph to my helperLibrary's replaceText("%citationYear%", theYear of theCitation, (text of theParagraph as string))

----- New code that pushes the contents 
----- of the clipboard into the document
				if text of theParagraph contains "%CitationRef%" then set text of theParagraph to the clipboard

The final document looks like this;
Screen Shot 2012-02-10 at 12.28.52 PM.png