var TextEdit = Application ( "TextEdit" ) ; var doc = TextEdit . documents [ 0 ] ; var s = doc . text . characters [ 0 ] . size ( ) ; TextEdit . includeStandardAdditions = true ; TextEdit . displayAlert ( s . toString ( ) ) ;