Forum Replies Created

Viewing 25 posts - 226 through 250 (of 353 total)
  • Author
    Posts
  • in reply to: Wait for key press, get Key #10860
    Stefan
    Participant

    .

    Ahh, just forgot:

    while GetKey() is waiting,
    the keypress should not be
    processed to the document
    but only to the macro.

    That means:
    if i have a selection
    this should not get dropped
    by the key press.
    OTOH, i could catch the selection
    from the macro too before waiting for the key!?!?

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

    .

    I had that again.

    I wanted to add a macro to an menu
    but could that only with macros listed in My Macros.

    Why?

    Why can i not just select a macro from an folder?

    .

    Stefan
    Participant

    .

    If you code yourself,
    maybe this snippet will point you to the right direction:

    Snippet plugin > General > Clipboard History

    .

    in reply to: Please add the ability to swap lines #10787
    Stefan
    Participant

    .

    You can extend EmEditor yourself.
    Just save a macro, add to My Macros, add an shortcut.
    (or use Snippet plugin)

    A macro could look like:

    SwapWithLineAbove.jsee


    document.selection.SelectLine(); //select line with cursor
    cLine = document.selection.text; //store line to var
    if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
    document.selection.Delete(); //delete line
    document.selection.LineUp(); //move cursor up one line
    document.write(cLine); //paste line from var

    or

    MoveLineUp_(on-and-on).jsee
    (assign to Shift+Alt+U)


    document.selection.SelectLine(); //select line with cursor
    cLine = document.selection.text; //store line to var
    if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
    document.selection.Delete(); //delete line
    document.selection.LineUp(); //move cursor up on line
    document.write(cLine); //paste line from var
    document.selection.LineUp(); //move cursor up one line

    and

    MoveLineDown_(on-and-on).jsee
    (assign to Shift+Alt+D)


    document.selection.SelectLine(); //select line with cursor
    cLine = document.selection.text; //store line to var
    if(cLine.indexOf("n") < 0){cLine = cLine + "rn";}
    document.selection.Delete(); //delete line
    document.selection.LineDown(); //move cursor down one line
    document.write(cLine); //paste line from var
    document.selection.LineUp(); //move cursor up one line

    – – –

    Swap Lines UpSideDown.jsee

    FROM:
    1 – x
    2 – Y
    3 – Z
    TO:
    3 – Z
    2 – Y
    1 – x


    Sel = document.selection.text;
    SelArr = Sel.split("rn"); SelArr.reverse();
    for(i=0,L=SelArr.length; i<L; i++){
    document.selection.text = SelArr[i];
    if(i<L-1){document.selection.text ="rn";}
    }

    .

    in reply to: Is there any way to disable Large File Controller? #10761
    Stefan
    Participant

    Fine you got it.

    Another tip is to google for an answer:

    google: [ emeditor Large File Controller ]

    to find e.g.
    http://www.emeditor.com/modules/feature1/rewrite/tc_13.html
    http://www.emeditor.com/modules/tutorials4/index.php?id=2

    .

    in reply to: Is there any way to disable Large File Controller? #10757
    Stefan
    Participant

    EmEditor Help
    – Command Reference
    – View category
    > Toggle Large File Controller command

    in reply to: How to clean unclosed HTML TAG ? #10636
    Stefan
    Participant

    What have you done?
    Step by step.

    – – –

    Also you may want to change my code

    str = document.GetLine( yLine );

    to

    str = document.GetLine( yLine ).toLowerCase();

    because indexOf is case sensitive.

    .

    in reply to: How to clean unclosed HTML TAG ? #10631
    Stefan
    Participant

    .

    * open EmEditor
    *
    * open a new document
    * paste the script in
    * save as e.g. Untitled.txt
    * click at “Macros > Select This”
    *
    * open your source document
    * put your cursor in ONE line
    * execute “Macro > Run Untitled.txt”
    * you should be prompted with “delete/all ok/nothing found” depending on the line content
    *
    * check for each line if the script works for you
    * if yes, the next step is to build a loop over all lines
    and at last exchange the “delete” message with an find&delete code

    Here the proof of concept code again
    but with comments:


    //settings:
    openTag = "<span";
    closingTag = "</span";

    //get current line number:
    yLine = document.selection.GetActivePointY( eePosLogical );

    //get line content:
    str = document.GetLine( yLine );

    //search for occurrences in this line:
    openTagPos = str.indexOf(openTag);
    closingTagPos = str.indexOf(closingTag);

    //if an closing tag is found:
    if(closingTagPos > -1){
    //if no opening tag is found at all
    //OR
    //if closing tag is found before the first opening tag
    if(openTagPos == -1 || (closingTagPos < openTagPos)){
    //<here find first closing tag and remove it>
    alert(closingTag + " to delete found");
    }else{
    //nothing to do in this line. This code can be removed.
    alert("lines is ok");
    }
    }else{
    //nothing to do in this line. This code can be removed.
    alert("not found " + closingTag);
    }

    in reply to: How to clean unclosed HTML TAG ? #10627
    Stefan
    Participant

    .

    Hi and welcome.

    1.)
    Do “<span" and "” always be on the same line?

    Or could it be that they are on different lines like

    1.


    CCNA Portable Command Guide

    Your example doesn’t provide this detail.

    – – –

    2.)
    Is it always the first occurrence of “” in a line that can be remove?

    Then the rule would be easier:
    if there is found a closing tag without an opening tag before, then it can be removed.

    Proof Of Concept:


    openTag = "<span";
    closingTag = "</span";

    yLine = document.selection.GetActivePointY( eePosLogical );
    str = document.GetLine( yLine );
    openTagPos = str.indexOf(openTag);
    closingTagPos = str.indexOf(closingTag);

    if(closingTagPos > -1){
    if(openTagPos == -1 || (closingTagPos < openTagPos)){
    alert("delete");
    }else{
    alert("all ok");
    }
    }else{
    alert("not found " + closingTag);
    }
    in reply to: Auto upgrade every day? #10611
    Stefan
    Participant

    I am not against updates ;-)

    Keep am coming :-D

    in reply to: Search and insert feature request #10587
    Stefan
    Participant

    Sorry, i don’t understood.
    I see nothing which is “insert before / insert after”.

    Rather i see an “break at comma” reformating.

    I would do it like this:
    – format the first lines yourself till the “modified:”

    – next do an search&replace:
    Find: ,
    Replace with: ,n
    [X]Use Escape Sequence

    – next do the indenting

    @Yutaka, this search&replace doesn’t respect this setting:
    “Configuration – General tab – Tab/Indent > [X]Enable Auto Indent”
    I had expected it would be auto -indent with s&r n too.

    in reply to: Leading zeros for Numbering command #10578
    Stefan
    Participant

    shastafir wrote:
    Disregard. Figured it out…

    Your post would have made much more sense
    if you would have provided an how-it-works :-x

    Like:

    To add decimal numbers with leading zeros
    with the “Edit > Advanced > Numbering… Alt+N” tool,
    just add the format you want
    into the ‘First Line:’ box of the ‘Insert Numbering’ dialog.

    Default is ‘1’, but you can also enter something like ‘001’ or so.

    .

    in reply to: Macro management similar to Snippet management #10536
    Stefan
    Participant

    .

    Do you know you can use the snippet plugin
    to insert snippets OR execute an macro?

    http://www.emeditor.com/modules/feature1/rewrite/tc_35.html

    .

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

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    If i use “Separated Values”
    the columns are nicely aligned
    at the given delimiter.

    But how can i insert spaces to
    have them separated even if i
    leave “Separated Values” mode?

    .

    in reply to: Restore Selection #10524
    Stefan
    Participant

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    Please consider to add “Restore last Selection”.

    I think that would be really useful.

    .

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

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    .

    Stefan wrote:

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

    .

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

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    .

    in reply to: External Tools: new argument to ask / prompt for parameter #10521
    Stefan
    Participant

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    .

    in reply to: Outline: add Type "Paragraph" #10518
    Stefan
    Participant

    .

    Reminder

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    Hi Yutaka.

    I still think there should be an easy way to just
    collapse whole paragraphs with the Outline plugin.
    (Just having blank lines as delimiter)

    I want to suggest to add “Paragraph”
    to the “Type” drop-down list.

    _

    EDIT

    in the meantime I have found a work around:

    Search and replace begin of paragraph with a dot.
    Find: ^$rn(.)
    Repl: nn.1

    Then use default Outline plugin Custom method for Text
    .
    ..

    ….
    …..

    Of course we can use another char then dot.
    .

    in reply to: Snippet: Expand / Collapse Folder #10517
    Stefan
    Participant

    .

    Yutaka wrote:
    Please let me know again if new features didn’t show up when the new major beta version becomes available.

    Hi Yutaka.

    If I import an big *.eesnip file, then all
    sub-folders are expanded automatically at import,
    and i have to collapse all folders by hand each
    to get an better overview.

    I can use Arrow-left/Arrow-right a few times
    but that takes time, especially with sub-sub folders.

    So i missed context menu item like
    * ViewCollapse all sub-folder

    Maybe that is an improvement idea for you?

    今後もよろしくお願い申し上げます。

    in reply to: Macro: Paste/Merge/Join two list together side-by-side #10488
    Stefan
    Participant

    Merge two list together side-by-side RANDOM-ized

    Hi folks, I was asked how to
    random the two list together side-by-side.

    Here is my answer:


    //EmEditor Script (JavaScript)
    // Merge two list together side-by-side RANDOM-ized
    // shuffle intermix stochastic stochastically
    // (see examples) Writes result to new document.

    //=======================================================
    //============ U S E R S E T T I N G S ==================

    // Separate your two input list by at least 5 #'s
    // Example input:
    // JAMES
    // JOHN <<< Left side in output
    // WILLIAM
    // RICHARD
    // CHARLES
    // ########## <<< Five or more #'s, but not less!
    // MARY
    // PATRICIA
    // LINDA <<< Right side in output
    // BARBARA
    // ELIZABETH
    Separator = "#####";



    // Delimiter to be used for separating
    // consecutive values on a single line.
    // Join both input lists side-by-side,
    // separated by that sign in the output
    // Example output:
    // WILLIAM + ELIZABETH
    // CHARLES + PATRICIA
    // RICHARD + BARBARA
    // JAMES + MARY
    // JOHN + LINDA
    // or
    // JOHN + BARBARA
    // JAMES + PATRICIA
    // RICHARD + ELIZABETH
    // CHARLES + LINDA
    // WILLIAM + MARY
    // or
    // WILLIAM + PATRICIA
    // JAMES + BARBARA
    // RICHARD + ELIZABETH
    // CHARLES + LINDA
    // JOHN + MARY
    // or...
    //
    Delimeter = " + ";



    //===========================================================
    //===========================================================
    //============ T H E S C R I P T ==========================

    document.selection.SelectAll();
    sel = document.selection.Text; //alert(sel);
    Lines = sel.split("rn"); //Using Windows Line Enders here
    SeparatorFound = false;
    arrONE = new Array();
    arrTWO = new Array();
    arrOUT = new Array();

    for(L = 0, Ls = Lines.length; L < Ls; L++){
    if (Lines[L].indexOf(Separator) != -1){
    SeparatorFound = true; continue; //SKIP
    }
    if (SeparatorFound==false){
    arrONE[L] = Lines[L];
    }else{
    arrTWO[L] = Lines[L];
    }
    }

    //Randomize the order of the array:
    arrONE.sort( function() {return 0.5 - Math.random()} );
    arrTWO.sort( function() {return 0.5 - Math.random()} );
    //Join the arrays side-by-side:
    for(idx=0,Len=arrONE.length; idx<Len; idx++){
    arrOUT[idx] = arrONE[idx] + Delimeter + arrTWO[idx];
    }
    //============ O U T P U T =================================
    OUT = arrOUT.join("rn");
    //alert(OUT);

    //Works with EmEditor:
    editor.NewFile();
    document.write(OUT);

    //The End
    //===========================================================

    shuffle intermix stochastic stochastically random randomized

    in reply to: Need F4—-One key repeat the last action,like MS word #10485
    Stefan
    Participant

    support++

    An “repeat the last action/command” command
    is very useful often.

    – – –

    The shortcut F4 is already taken
    but we can assign an key at our own.

    On the other hand it is nifty
    if such basic features have an shortcut by default
    so all would know what we talked about.

    As far as i see, Ctrl+R is free.

    .

    in reply to: Register both 32- as well as 64-bit shell extensions #10477
    Stefan
    Participant

    >>
    “”unfortunately, XYplorer doesn’t show EmEditor’s entry
    in its context menu, unlike Windows Explorer (64-bit).””

    Do you really need an context menu?

    With XYplorer you have several possibilities
    to call EmEditor with one or all selected files:

    * from an button
    * from the catalog on the left
    * from User Menu
    Open selected item(s) with:..EmEditorEmEditor.exe

    * via an shortcut
    e.g.: Shift+E

    * via Portable File Association by double clicking an file directly
    * via Portable File Association by opening an context menu first
    +|”Open with &EmEditor ” *>”..EmEditorEmEditor.exe”
    or
    +|”Open with &EmEditor ” txt;log;cpp;h>”..EmEditorEmEditor.exe”

    .

    in reply to: Lookbehind search in a macro is not allowed? #10472
    Stefan
    Participant

    Isn’t that normal?

    Just google a bit:

    JavaScript and VBScript doesn’t supported Lookbehind at all.
    Lookahead is fully supported.

    You can use Python or Perl if you want to use Lookbehind.

    EmEditor Help – EmEditor Macro Reference – Directives
    #language directive

    (though that languages are not installed on windowsTM as default)

    .

    in reply to: Macro: GoTo and select… collection #10465
    Stefan
    Participant

     

    2.) GoTo and select to line X

    Purpose:
    select the lines from start line to line number X.
    Where X is a line number you entered to go to.
    Tip; Line X can be below or above current line.

    2a) EmEditor internal commands:

    To select an block:
    * set your cursor on the start of the line you want
    * press F8 to set “begin of block marker”
    * press Ctrl+G and enter the line number to go to
    (Tip: press ESC to leave selection mode)

    To select whole lines:
    * same as above but press Ctrl+F8

    To select an rectangular/vertical block:
    * set your cursor on the line and column you want
    * press Ctrl+Shift+F8 to set “begin of block marker”
    * press Ctrl+G and enter the line and column number to go to
    (Tip: press ESC to leave selection mode)

    Search the help for “F8”:

    EmEditor Help – How to – Edit
    To Select a Portion of a Document

    Click at the beginning of the selection,
    move the mouse to the end of the selection while holding
    the left mouse button down, and then release the mouse button.

    Tips
    Alternatively, press arrow keys while pressing the SHIFT key.
    Alternatively, press the F8 key, and then press arrow keys.
    To select lines, click on the left edge of the window,
    or press CTRL + F8.
    To select vertically (in a rectangular block), use the
    mouse to select while pressing the ALT key,
    or press SHIFT+ CTRL + F8.

    2b) If you want to use an script for that,
    the following code could be an start:

    To select an block:
    * set your cursor on the line you want
    * execute this script and enter the line number to go to

    o = document.selection;
    yPos = o.GetActivePointY(eePosLogical);
    TargetLine = prompt("Select to line:","");
    o.LineDown(true, (TargetLine - yPos));

    To select whole lines:
    – start at begin of line
    – at the end hold Shift-key and press End-key
    Or add this to the end of the script:
    document.selection.EndOfLine(true, eeLineLogical);

    To select an rectangular/vertical block:
    – i will post next…

    .

Viewing 25 posts - 226 through 250 (of 353 total)