Check the language that's actually applied to the text. In paragraph styles, that's under Advanced Character Formats. Also if you have character styles in your document, make sure that they don't have any language specified in their definitions so the paragraph styles' language setting doesn't get overridden.
Thanks for your reply Mary.
The correct dictionary (Italian) is selected in all the cases, even though the InDesign shows the hyphenation in wrong places.
And is there any custom dictionaly available in the web so that it can be added to the Indesign dictionary library. If so, can you direct me the path.
No errors in the Italian dictionary. Both are correct hyphenation: ui is a diphthong and in the Italian language can be divided into two syllables. Constitui-ranno is more common and elegant, but constitu-iranno is not a mistake.
Sorry for my english.
For future reference, this is the InDesign Scripting forum, where you can bring your scripting problems.
There is a separate InDesign forum that covers the non-scripting questions.