Hello!
Peter Kahrel has shown in his script »hyphenate.jsx« as it could work.
---
To add words to the dictionary, you can use the following snippet.
e.g. userDictionaries[17]: »Deutsch: 2006 Rechtschreibreform« in InDesign CS6 (De) (index has changed with versions), 21: English: USA
var _selectedWords = app.selection[0].words.everyItem().contents;
var _userDicDe = app.userDictionaries[17];
_userDicDe.addWord(_selectedWords);
Possibly an first approach ...
Roland