Mac computers have various methods by which the user can insert special characters; these include keyboard shortcuts, the character viewer, and text replacement. Most users need nothing more.
I find the character viewer a bit difficult to use, and I have trouble remembering keyboard shortcuts and text-replacement characters for infrequently-used characters. So, I wrote the script included below.
To test this script, simply open and run it in Script Editor. Adding a new character to the script requires its decimal ID, which can easily be found online, and the site I use (because it’s easily searched) is linked below. There is no requirement as to the name of the special character. This script should work with any application that has an Edit > Paste menu item.
https://kellykjones.tripod.com/webtools/ascii_utf8_table.html
use framework "Foundation"
use scripting additions
on main()
set characterData to {{"dash - em", 8212}, {"dash - en", 8211}, {"divide", 247}, {"double angle - left", 171}, {"double angle - right", 187}, {"double quote - left", 8220}, {"double quote - right", 8221}, {"ellipsis", 8230}, {"not equal to", 8800}, {"plus or minus", 177}, {"single quote - left", 8216}, {"single quote - right", 8217}, {"space - nonbreaking", 160}}
set characterData to sortTheList(characterData) -- this can be removed if sorting is not desired
set characterSettingPlist to "com.peavine.CharacterInsert"
set dialogDefault to item 1 of readPlist(characterSettingPlist, "")
set characterDescriptions to {}
repeat with aList in characterData
set end of characterDescriptions to item 1 of aList
end repeat
set theCharacters to (choose from list characterDescriptions default items dialogDefault with prompt "Select one or more characters to insert" with title "Character Insert" with multiple selections allowed)
if theCharacters = false then error number -128
set theIDs to {}
repeat with i from 1 to (count theCharacters)
repeat with j from 1 to (count characterData)
if item i of theCharacters = item 1 of item j of characterData then
set end of theIDs to item 2 of item j of characterData
exit repeat
end if
end repeat
end repeat
set the clipboard to character id theIDs
tell application "System Events"
set appName to (name of first process whose frontmost is true)
tell process appName
set frontmost to true
click menu item "Paste" of menu "Edit" of menu bar 1
end tell
end tell
writePlist(characterSettingPlist, {theCharacters})
end main
on sortTheList(theList)
repeat with i from (count theList) to 2 by -1
repeat with j from 1 to i - 1
if item 1 of item j of theList > item 1 of item (j + 1) of theList then
set {item j of theList, item (j + 1) of theList} to {item (j + 1) of theList, item j of theList}
end if
end repeat
end repeat
return theList
end sortTheList
on readPlist(thePlist, theDefault)
set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:thePlist
theDefaults's registerDefaults:{theKey:theDefault}
return theKey of theDefaults as list
end readPlist
on writePlist(thePlist, theList)
set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:thePlist
set theKey of theDefaults to theList
end writePlist
main()