Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20719
    LTT
    Participant

    When no text is selected, running a macro using eeReplaceSelOnly causes “unspecified error”.
    This macro worked fine in the past.

    [Prompt when End of Document is Reached] is enabled;
    Run:
    document.selection.find(str, eeFindNext | eeFindAround);
    When it prompts me, canceling the dialog causes “unspecified error”.

    By the way,
    —–
    Prompt when End of Document is Reached:
    If this is checked, EmEditor will display a dialog box to prompt the user when Search reaches the end of the document.
    —–
    According to this description, shouldn’t EmEditor also prompt the user even when the Around option is off?
    When the sound is muted, I often ignore the message on the status bar, and do [Find Next] one or two more times, till I see it reached the end…

    #20726
    Yutaka Emura
    Keymaster

    Hello LTT,

    “Unspecified error” is a correct behavior. If you want the script to continue even if the Unspecified error appears, you can surround the code with try … catch statement.

    For example:

    try {
    	document.selection.Find( "abc", eeFindNext | eeFindAround );
    }
    catch ( e ) {
    	alert( "dialog box dismissed" );
    }
    alert( "end of macro" );
    
    

    I hope this helps.
    Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.