var AI = Application ( "Adobe Illustrator CC 2014" ) ; var doc = AI . documents [ 0 ] ; var lay = doc . layers ; var layName = lay [ 0 ] . name ( ) ; AI . includeStandardAdditions = true ; AI . displayDialog ( layName ) ;