While ago I've added some minor features. So here we go:
/**
* helper for using the clipboard in user macro functions/commands
*
* @param text text to copy/append to clipboard
* @param doAppend append given text to the current clipboard
* @param clipboard_type 'CHAR' , 'LINE' or 'BLOCK'
* @param clipboard_name usually ''
* @param quiet print status message or not
*
* @return 0: OK
* TEXT_NOT_SELECTED_RC: empty text - nothing to copy/append
*/
_command int text_to_clipboard( _str text = '', boolean doAppend = false, _str clipboard_type = 'CHAR', _str clipboard_name = '', boolean quiet = false ) name_info(','VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
// s.th. to copy ?
if ( length( text ) )
{
if ( !doAppend ) push_clipboard_itype( clipboard_type,clipboard_name,1,true );
append_clipboard_text( text );
if ( !quiet ) message( "'" text "' " (doAppend ? "appended" : "copied") " to clipboard [" clipboard_type "]" );
return 0;
}
else return TEXT_NOT_SELECTED_RC;
}
Have fun, HS2