Why is alert("...") not working in an UltraEdit script?

Why is alert("...") not working in an UltraEdit script?

2
NewbieNewbie
2

    Mar 14, 2018#1

    Hi, everyone,

    I'm a very new coder and user to UltraEdit; I'm wondering if someone could help, please.
    I cannot seem to get a simple alert window to appear when I run my scripts; it seems to be okay with other editors such as TextWrangler and Komodo, so I was wondering why it doesn't on UltraEdit.

    Just a simple code such as

    alert("Hello");

    will activate a pop-up normally, but not with UltraEdit.
    It might be worth mentioning I'm only using the trial version right now with a view to purchasing, but perhaps it is enabled in the licensed version. 
    Any help would be most appreciated. Many thanks,

    Graham

    6,688587
    Grand MasterGrand Master
    6,688587

      Mar 15, 2018#2

      The function alert is not part of JavaScript core. It is an application specific extension which browsers have and also some text editors with support for JavaScript. JavaScript core has no support for functions which depend on operating system like showing a message box.

      UltraEdit has:

      Code: Select all

      UltraEdit.messageBox("Message to show in a message box.");
      UltraEdit.messageBox("Message to show in a message box.\n\nOne more line after an empty line.","Title of message box");
      Further there are:

      Code: Select all

      UltraEdit.getString("Please enter string written into file:",0);
      var sInput = UltraEdit.getString("Please enter string assigned to variable:",1);
      UltraEdit.getValue("Please enter positive integer number written to file:",0);
      var nNumber = UltraEdit.getValue("Please enter positive integer number assigned to variable:",1);
      UltraEdit.outputWindow.clear();           // Clear output window.
      UltraEdit.outputWindow.write("Message written into output window.");
      UltraEdit.outputWindow.showWindow(true);  // Make output window visible if currently hidden.
      // Disable writing status and error messages of JavaScript interpreter
      // to output window. This should be used only after script is tested
      // completely because of suppressing error messages during development
      // of a script is no good idea.
      UltraEdit.outputWindow.showStatus=false;
      var_dump(Variable);   // Dumps variable value or entire object to output window for debugging purposes.
      var_dump(UltraEdit);  // Dumps entire UltraEdit object with all properties and functions to output window.
      
      I do not use UltraEdit for Mac, just UE for Windows. UltraEdit for Windows has a Tag List view and is installed with a tag list file containing several tag groups. One of these tag groups is UE/UES Script Commands with all UltraEdit specific scripting extensions to JavaScript core ready for inserting with a double click on the tag with positioning caret on first position where to enter something or embed the current selection within inserted tag at first position on where to type something. I don't know if UltraEdit for Mac is also installed with a tag list file and has the tag list view.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Mar 15, 2018#3

        Hi, many thanks for your detailed reply, much appreciated.
        Graham