Integrating Scrivener with Devonthink and Bookends

This is pretty old, but I was wondering if anyone managed to find a solution to the diacritics problem.

I have found a solution years ago and have posted it in the Bookends forum but forgot to update it here. This is the updated version:

    tell application "Bookends"
	set theIDString to «event DNtpRUID» "selection"
	set theauthor to «event ToySRFLD» theIDString given string:"authors"
	if theauthor is "" then
		set theauthor to «event ToySRFLD» theIDString given string:"editors"
		if theauthor is "" then
			set theauthor to "Anon."
		end if
	end if
	set theyear to «event ToySRFLD» theIDString given string:"thedate"
	set devonthinkReference to «event ToySRFLD» theIDString given string:"user20"
	
	set oldDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to linefeed
	set theauthorList to every text item of theauthor
	set theauthorListCount to length of theauthorList
	set AppleScript's text item delimiters to ", "
	set ErsterAutor to (first item of theauthorList as string)
	set theauthorVollname to every text item of ErsterAutor
	if theauthorListCount = 1 then
		set theauthor to (first item of theauthorVollname as string)
	else if theauthorListCount > 2 then
		set theauthor to (first item of theauthorVollname as string) & " u. a."
	else if theauthorListCount = 2 then
		set ZweiterAutor to (second item of theauthorList as string)
		set theauthorVollname2 to every text item of ZweiterAutor
		set theauthor to (first item of theauthorVollname as string) & "/" & (first item of theauthorVollname2 as string)
	end if
	set AppleScript's text item delimiters to oldDelimiters
	
	set authorYear to theauthor & ", " & theyear
	if devonthinkReference is "" then
		set theReference to "{" & authorYear & ", #" & ("<font face=\"times new roman\"><a href=\"" & "bookends://sonnysoftware.com/" & theIDString & "\">" & theIDString & "</a></font>") & "}"
	else
		set theReference to "{" & ("<font face=\"times new roman\"><a href=\"" & devonthinkReference & "\">" & authorYear & "</a></font>") & ", #" & ("<font face=\"times new roman\"><a href=\"" & "bookends://sonnysoftware.com/" & theIDString & "\">" & theIDString & "</a></font>") & "}"
	end if
end tell

set RTFtheReference to (do shell script "echo " & quoted form of theReference & " | textutil -stdin -stdout -inputencoding utf-8 -format html -convert rtf | pbcopy")
tell application "Scrivener"
	activate
end tell

tell application "System Events"
	key code 9 using {command down} -- v key
end tell