It works fine with me on InDesign CS6, OSX Yosemite.
Perhaps another part of the code is giving you trouble, upload a screenshot.
Works here too.
Btw, there is a way to address InDesign without reference to the version:
tell application id "com.adobe.indesign"
set user interaction level of script preferences to never interact
I can't vouch for CS6, but I know that script works in CC because I used it in a script last night. What is the error that you are getting?
Somehow, it worked fine today. I should have restarted my Mac yesterday.
Than you very much to those who replied.