Forum Replies Created

Viewing 25 posts - 201 through 225 (of 353 total)
  • Author
    Posts
  • in reply to: count and select all the regex matches #10937
    Stefan
    Participant

    user wrote:
    hello!

    how can I return the number of found regex matches?

    how can I select the regex matches?

    thanks!

    One could utilize a macro like this basic example:

    //Text to parse for RegEx:
    selText = document.selection.text;

    //Show matches:
    vResults = findMatches(selText);
    alert(vResults);


    function findMatches(inputStr){
    //Build an expression to match what you want:
    //var regex = /dddd/ig; // match 2013
    var regex = /www..+?..{2,3}/ig; //match www.emeditor.com

    //To avoid errors, check beforehand if test is successful:
    if(regex.test(inputStr)){
    //if test was ok, collect matches:
    result= inputStr.match(regex);
    //some cosmetic:
    count = result.length;
    status = "Macro found " + count + " matches.";
    //return result to caller:
    return result.join("rn");
    }else{
    return "No match found.";
    }
    }

    _

    in reply to: open multiple links #10935
    Stefan
    Participant

     
     
    I have searched for an good regex to match url.
    An basic for an script could be:

    //Text to parse for URL:
    selText = document.selection.text;
    //
    //
    //Show matched URLs:
    vURLs = findUrls(selText);
    alert(vURLs);
    //
    //
    //Open matched URLs:
    vURLs = findUrls(selText);
    openUrls();
    function findUrls(searchText){
    // gruber revised expression - http://rodneyrehm.de/t/url-regex.html
    var regex= /b((?:[a-z][w-]+:(?:/{1,3}|[a-z0-9\%])|wwwd{0,3}[.]|[a-z0-9.-]+[.][a-z]{2,4}/)(?:[^s()<>]+|(([^s()<>]+|(([^s()<>]+)))*))+(?:(([^s()<>]+|(([^s()<>]+)))*)|[^s`!()[]{};:'".,<>?«»“”‘’]))/ig;
    result= searchText.match(regex);
    if(result){return result.join("rn");}else{return false;}
    }
    function openUrls(vURLS){
    var ie = new ActiveXObject("InternetExplorer.Application");
    ie.Visible = true;
    arr = vURLs.split("rn");
    for(i=0,E=arr.length; i<E; i++){
    vURL = arr[i];
    ie.Navigate(vURL);
    pause(1000);

    if(i==3) quit(); // for debugging only
    }
    }
    function pause(ms) {
    ms += new Date().getTime();
    while (new Date() < ms){}
    }

    This will open every url in IE but in same tab. Use History back.

    You may want to find a solution to open each url in a new tab.

    You can utilize other browsers maybe by using a code like:
    var wsh = new ActiveXObject(“WScript.Shell”);
    wsh.run(“notepad.exe”, 1, True);

     

    in reply to: open multiple links #10932
    Stefan
    Participant

    user wrote:
    is it possible to select multiple links and open all of them in default web browser with one click?

    You can not do more then one selection at once.
    But you can use a script/macro to extract and collect all URLs
    and then use something like (For Each URL in URLs Do “open browser”)

     

    in reply to: count and select all the regex matches #10931
    Stefan
    Participant

    user wrote:
    count all the regex matches
    I just want to have these options when I do a regex search

    You can check “[X] Count Matches” and click at [Find Next]
    to see the count in the status bar.

    user wrote:
    select all the regex matches
    I just want to have these options when I do a regex search

    You can click at [Bookmark All]
    and then utilize “Edit > Bookmarks”

    Or use a script/macro to collect all matches.
    In the Library you can find e.g. “Macro to extract strings using regular expression”

    in reply to: Show/hide all visualization characters #10920
    Stefan
    Participant

     
     
    Toggle ALL marks at once (Space Tabs EOL EOF)

    Often i want to see more then one kind of mark (Space, Tab, Line ends, End of file)

    and therefor i have to go three/four times to the menu “View > Marks”
    to enable or disable only one mark kind at each visit.

    I had created an macro for this too

    But I want to suggest to add an menu item
    “View > Marks > Toggle Marks Visibility

     

    in reply to: Suggestioin on box-editing #10919
    Stefan
    Participant

     
     
    Hi Yutaka,

    did you have found some time to look into this issue?

    Can this feature become improved please?

    Stefan wrote:

    I would also like to be able
    to move the zero-width vertical selection ( | )
    with the left/right arrow keys
    to modify several columns
    without the need to do an selection again and again.

     

    in reply to: Macro s & r in block column selection #10918
    Stefan
    Participant

     
     
    This is still the same with EmEditor v12.0.11.

    Since Yutaka didn’t response on this
    I do not know if is this an bug?

    If yes, can this be improved please?

    If No, what would be the indicated workaround please?

    Stefan wrote:
    Hi Yutaka, i have an problem with replacing text
    in an column/block selection from an macro.

    Tested with 11.0.5 and 11.1.7

    My problem:
    if i take the block selected text,
    and manipulate it with an macro,
    the macro works correct
    but the text replacement in the document
    replaces all selected lines
    with the replacement of the first line only.

     

    in reply to: CSV and "Fill with…" feature #10917
    Stefan
    Participant

     
     
    Hi Yutaka, unfortunately I have seen no feedback from you about this issue.

    Don’t you think this would be a nifty enhancement?

     

    Stefan
    Participant

     
     
    Hi Yutaka, thank you for the feedback.

    This works for Snippets… but I want to use this “parameter request box” for tools too.

    It could be used for many purposes. Do you think you will implement this?

    Thanks!
    Stefan

    in reply to: External Tools: new argument to use clipboard content #10915
    Stefan
    Participant

     
     
    Thank you for the feedback, Yutaka!

    Will this be added to the next release?

     
    Thanks you. 

    in reply to: enhancements on the numbering feature #10914
    Stefan
    Participant

     
    Hi Yutaka,

    I want to suggest to
    * add an option “[X]Skip empty lines”
    * add an option “[X]Restart numbering after empty lines”

    what do you think about this improvement?
    Do you consider to add this feature into the next release?

    Thanks for any feedback.

     

    in reply to: Restore Selection #10913
    Stefan
    Participant

     
    Hi Yutaka, you are very quiet ;-)

    Do you consider to implement “Restore last Selection” in the next release?

    Thanks for any feedback.

     

    in reply to: Add ${EE_PATH} and ${EE_Drive} parameter #10908
    Stefan
    Participant

     

    Hello Yutaka,

    many thanks for feedback, very appreciated!

    Unfortunately I do not understand.

    As you may know already very well

    $(Dir) or better ${Dir} will return the path of the current open document.

    Whereas ${EE_PATH} would point always to the folder where the EmEditor.exe is in.

    So unfortunately this will not help me much ;-)

    So I still wants you to consider to implement this new parameters
    ${EE_PATH} = path to EE folder
    ${EE_DRIVE} = drive letter from which EE is currently started.

    That are standard parameters to work always portable,
    no matter where EmEditor is installed or which drive letter
    the USB thump drive have gotten this day.

    Thank you.

    I hope I have not missed something obviously?

    Yutaka wrote:

    but ${EE_PATH} is $(Dir).

     

    in reply to: get help on function using standart chm files #10905
    Stefan
    Participant

    Thanks Yutaka, this tool works on Win7 64-bit too.

    Command: .eehelptool.exe
    Arguments: ._DOKUAutoHotkey.chm $(WordText)

    I can utilize it as snippet too.

    But only with #cmd:
    `#cmd X:EmEditoreehelptool.exe X:EmEditorAHKAutoHotkey.chm ${WordText}`

    Unfortunately it doesn’t works with ShellExecute:
    `- X:EmEditoreehelptool.exe X:EmEditorAHKAutoHotkey.chm ${WordText}`

    The command executes (i can tell from task manager)
    and the output panel opens, EE is busy… that’s all.

    But i want to use ShellExecute to be able to use relative paths:
    `- eehelptool.exe AHKAutoHotkey.chm ${WordText}`

    Any suggestions please?
    Do I something wrongly?

    .

    Stefan
    Participant

     

    btw

    the easter egg of EmEditor is Tools > All Commands…

    :-D

     

    Stefan
    Participant

    Hi,

    you are welcome!

    >However, @ 1st, it doesn’t work,
    Yes i know, that’s called “learning by doing”.
    That way you will recognize it better rather
    then I had provided you to the whole solution.

    >is it SAFE to enter the value very high (I mean 100 for example).
    Yes it will be save, especially since you limited it
    by utilizing the non-greedy modifier.
    Only with even higher value on looong documents
    on older computers from the nineties this would
    be an issue i guess.

    .

    Stefan
    Participant

    .

    In the find dialog click at Customize…

    and enable “[X] Regular Expression can match new line characters”

    Than just RegEx search for “Deep.+thumb up.”

    If you have more then one of such block in the document, then
    search non-greedy “Deep.+?thumb up.” to select only one block at time.

    OR prefix your expression by “(?s)”
    “(?s)Deep.+?thumb up.”

    It’s like the JAVA pattern DOTALL
    to allow the dot to match newline characters, too.

    Or the perl single-line modifier ‘s’ which treats a string as single line.
    That is, change “.” to match any character whatsoever,
    even a newline, which normally it would not match.

    An other trick is to utilize [sS] to match any character:
    “Deep[sS]+?thumb up.”

    Read more at http://www.regular-expressions.info/reference.html
    .

    in reply to: Snippet: Show me what is in by an tool tip #10896
    Stefan
    Participant

    Stefan wrote:

    (Maybe show the first 8 lines only. I will take care to ad a few comments at the top of the snippet for that.)

    Currently the preview of the TEXT field shows the first six lines.

    But for some snippets, used to show an text as help in a tool tip only,
    i have the need to see the whole text as tool tip.
    (like it shows in the document after i have typed the trigger)

    Question:
    Could there be a check box in the snippet properties box to enable that?

    .

    in reply to: help with macros #10894
    Stefan
    Participant

    .

    Please try to find better subject lines for your threads
    and use different threads for different kind of topics.

    .

    To do most of this, best learn Regular Expressions.

    For example on:
    – delete everything included in brackets (xxx) including the (brackets) themselves

    Find: (.+?)
    Replace:
    [X] Use Regular Expressions

    will match first
    (xxx)
    and then
    (brackets)

    due to the ‘?’ regex parameter.

    Whereas

    Find: (.+)
    Replace:
    [X] Use Regular Expressions

    will match whole
    (xxx) including the (brackets)

    – – –

    For [ and ]
    use

    Find: [.+]
    Replace:
    [X] Use Regular Expressions

    – – –

    – delete everything after the first ( in everyline, including the bracket itself

    Try
    Find: (.+$
    Replace:
    [X] Use Regular Expressions

    – – –

    – delete double or more spaces (not tabs) and replace them with one space

    Try
    Find: ~~+
    Replace: ~
    [X] Use Regular Expressions

    (instead of ‘~’ enter an blank each)

    – – –

    To create a macro try to utilize
    – “Macro > Start”
    – do the work, here the find and replace job
    – “Macro > Stop”
    – “Macro > Edit” –> you will see the macro code to reuse
    (you may want to read the help about e.g. “eeFindSaveHistory” and remove this from the macro)

    – – –

    For the other questions *I* suggest you to open different threads
    for each topic to not mix up all the answers and queries and for an back.

    _

    in reply to: which is the procedure to update a portable EmEditor? #10893
    Stefan
    Participant

    .

    Take a look into the downloaded archive:
    there are no settings file in, which could overwrite anything.
    But there are also the file templates. You may want to take care
    if you have modified such templates before for your own needs.

    Basically just
    – close EmEditor
    – (copy folder with current version to an save place,
      in case new versions contain fresh bugs, or something went wrong)
    – if you have altered one of the template files yourself, copy them
    – unpack the archive
    – overwrite your EmEditor folder with new files
    Done.

    .

    in reply to: Wait for key press, get Key #10873
    Stefan
    Participant

    .

    Ah, i see. To bad.

    Thank you for the clarification.

    .

    in reply to: Wait for key press, get Key #10871
    Stefan
    Participant

    .

    Hi Yutaka, i think you know that i already utilize the snippets a lot.

    But i don’t know how i can wait for a key press.

    Basically i want to
    – start a macro
    – wait for the user pressing any key
    – store that key to a variable
    – continuing the macro

    I have many ideas to use this.

    If you happen to know how i can do this
    right now, please tell me by an example.

    If it is not possible right now,
    please consider to implement something like “GetKeyPress();”

    Thank you.

    in reply to: Customize Menu: New Command Category "Load Macro" #10868
    Stefan
    Participant

    OK, thank you.

    .

    in reply to: Allow Env Vars for "Save Backups to Backup Folder" #10867
    Stefan
    Participant

    Yutaka wrote:
    Environment variables are not supported for the Backup folder. If this is something you desire, I will add this feature in future versions.

    Well, since i use EmEditor portable
    i just want to make this path portable too,
    and pointing it e.g. to user profile folder
    (You know: no matter if user is stefan or admin)
    Or to a other partition which is defined by
    an own created env var \%Backups\%.

    But at least we can use relative paths here:
    [ .Backups ]

    So i can life with that but to make EmEditor even more portable
    i want to suggest to respect this fact on all places.
    So,… if you find some time to implement this it would be appreciated .

    Yutaka wrote:
    By the way, this is not a plug-in feature, but rather an EmEditor core feature.

    Yes, sorry, i have just clicked the wrong forum by accident.
    Please move it if you want.

    Thank you.

    in reply to: Customize Menu: New Command Category "Load Macro" #10863
    Stefan
    Participant

    .

    Thanks for answers. But it seems i don’t get it.

    Hi Yutaka,
    i know i can organize My Macros contents from the
    Customize Macros dialog – My Macros tab. Thank you.

    My point is that i do not understand why i have to add a macro
    to My Macros first, if i just want to add a macro to a menu?

    e.g.
    I utilize “Tools > Customize Menu…” and want to add a macro.
    But for “Command” i can only chose a macro from My Macros.
    So i have to first add my macro to My Macros.
    This way i have the macro two times; one time
    in My Macros and one time in my menu.

    The same suggestion for “Tools > Properties > [Keyboard]”
    to assign a keyboard shortcut to a macro.
    Why do i have to add a macro first to My Macros?

    That is why i asked to utilize a macro even it is
    not in My Macros but directly from folder.

    Advantage:
    1.) The My Macros list is not filled with unwanted items.
    2.) I save an step for adding a macro to an menu or assign an hotkey.

    YE> I need to keep all compatibilities between old and new versions,

    OK, i understand that.
    But just an additional “Select Macro from folder…” item
    in the dialogs can not be that evil?
    Or would it break that much the concept?

    Or can we organize macros in sub-folders?
    So that the sub folders are shown in the My Macro menu too?

    .

Viewing 25 posts - 201 through 225 (of 353 total)