Maybe take it as starting point for your own macro or just use it...
#pragma option(strict,on)
#include 'slick.sh'
_command void count_selchars( boolean deselect = true ) name_info (','VSARG2_MARK|VSARG2_TEXT_BOX|VSARG2_READ_ONLY)
{
if ( _isnull_selection() )
{
message ("Nothing selected !");
return;
}
int cnt = 0;
_str seltext;
filter_init();
while ( filter_get_string(seltext) == 0 )
cnt += length( seltext );
filter_restore_pos();
if ( deselect ) _deselect();
message("selected " cnt " chars");
}
There are also other methods possible e.g. duplicate the selection to a temp buffer and get it's size or use the temp buffer for further operations.
Have fun,
HS2