var sys = Application ( "System Events" ) ; var docLength = sys . users . length ; var app = Application . currentApplication ( ) ; app . includeStandardAdditions = true ; app . displayDialog ( docLength . toString ( ) ) ;