var PS = Application ( "Adobe Photoshop CC 2014" ) ; var doc = PS . documents [ 0 ] ; var lay = doc . layers ; var docLength = lay . length ; var layName = lay [ 0 ] . name ( ) ; PS . includeStandardAdditions = true ; PS . displayDialog ( layName ) ;