Add *.js, or *.jsx to Applications -> Adobe Illustrator CC -> Presets -> en_GB -> Scripts
“en_GB” is the languages code, so it can be different on your Mac OS.
Start or restart Illustrator
Go to menu: “File -> Scripts”. The script(s) you just added should appear in the list.