var InD = Application ( "Adobe Indesign CC 2014" ) ; var doc = InD . documents [ 0 ] ; var docLength = doc . pages . length ; InD . includeStandardAdditions = true ; InD . displayDialog ( docLength . toString ( ) ) ;