Home Forums General XMetaL Discussion Adding non-breaking hyphen Reply To: Adding non-breaking hyphen


Reply to: Adding non-breaking hyphen

I am surprised no one offered a short macro, yet, to just insert a single character. In XMetaL Author this macro can be assigned to a shortcut, menu and a toolbar icon.
Something like this should work (not tested!!)

  if(Documents.Count==0) {
    Application.Alert( “No Document is currently Open.” ); return;
  } else if (Selection.CanInsertText) {
    Selection.Text = String.fromCharCode(173); // Replace 173 with decimal unicode
  } else {
    ActiveDocument.Host.Alert(“Cannot insert text here!”);

Store the code in a file with .mcr type in Startup folder and restart XMetaL Author. Ctrl+Alt+H will enter the character defined in the code.
**** DISCLAIMER: Code is not tested but given for reference only. ****