#8737

Yutaka Emura
Keymaster

Hi user,

This is an example of a JavaScript macro:


sText = document.selection.Text;
if( sText != "" ) {
menu = CreatePopupMenu();
nCount = editor.Documents.Count;
for( i = 1; i <= nCount; i++ ){
doc = editor.Documents.Item( i );
if( doc != document ){
menu.Add( doc.FullName, i );
}
}

result = menu.Track( 0 );
if( result != 0 ) {
docOrg = document;
doc = editor.Documents.Item( result );
doc.Activate();
document.selection.EndOfDocument();
document.selection.Text = sText;
docOrg.Activate();
document.selection.Delete();
}
}