Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8837

    Thyresias
    Participant

    こんにちは

    I would like to implement the following behavior in a macro:
    – if the selection is empty, repeat the last find command
    – if it is not, find the selected text

    I tried this:

    if (document.selection.IsEmpty)
    document.selection.FindRepeat(eeFindRepeatNext);
    else
    document.selection.Find(document.selection.Text, eeFindNext + eeFindAround);

    It works when the selection is not empty, but when it is, it will repeat the last find entered through the dialog box, not the one performed by the macro through selection.Find.

    Is there a way:
    – to store the arguement of selection.Find as the last search
    – to query EmEditor about the current find settings (ideally, if regular expressions are on, you just want to do “repeat find” even if the selection is not empty)

    Thanks
    — Thierry

    #8842

    Yutaka Emura
    Keymaster

    Hello Thyresias,

    Can you try adding the eeFindSaveHistory flag to the Find method? This flag should save a searched string.

    For details, please see:

    http://www.emeditor.com/help/macro/selection/selection_find.htm

    Unfortunately, I don’t think there are any ways to query EmEditor about the current find settings.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.