Forum Replies Created

Viewing 25 posts - 276 through 300 (of 345 total)
  • Author
    Posts
  • in reply to: extract text #10306
    Stefan
    Participant

    Note, with last beta
    “Head-start version: EmEditor Professional v11.1.6 beta”

    you can also use:

    * Find: [ pattern ] with [Bookmark all]
    * “Invert Bookmarks in This Group”
    * “Delete Bookmarked Lines in This Group”

    in reply to: extract text #10305
    Stefan
    Participant

    user> what’s next?

    ??

    * Save this script/macro to an text file with VBS or VBEE extension.
    (please save it again, i have edited an comment failure in the meantime)

    * Macros > Select this (means the current open macro file)
    or use
    * Macros > Select… >>> choose the macro

    * Open your text file to edit.
    * Select an paragraph or the whole text (Ctrl+a)

    * Execute the macro: Macros > Run myMacro.vbs

    ??

    EmEditor Help > EmEditor Macro Reference > Tutorial > Run Macro

    in reply to: extract text #10302
    Stefan
    Participant

    Delete Lines NOT containing STRING

    #language = "VBScript"

    FileText = document.selection.Text
    If FileText = "" Then
    alert "Nothing selected?" & vbCRLF _
    & "This script works with selected text only."
    Quit
    End If

    PromptText = "Remove lines containing this search string"
    searchStr = prompt(PromptText, "")
    If searchStr = "" Then Quit

    Lines = Split(fileText, vbCRLF)
    For each line in Lines
    funcRegEx searchStr, line
    '//FALSE = line not contains search pattern
    '//TRUE = line contains the search pattern
    If funcRegExReturn = FALSE Then
    resultText = resultText + line + vbCRLF
    End If
    Next

    'editor.NewFile()
    document.writeln(resultText)

    Function funcRegEx(needle, haystack)
    funcRegExReturn = FALSE
    Set regEx = New RegExp
    regEx.Pattern = needle
    regEx.IgnoreCase = True
    regEx.Global = True
    If regEx.Test(haystack) Then
    funcRegExReturn = TRUE
    End If
    End Function
    in reply to: replace string in placeholder ($1)? #10297
    Stefan
    Participant

    This is how i see it. Don’t know if i am 100\% correct.

    n

    “n” are RegEx METACHARs from the old UNIX days with his SED and GREP tools.

    “1” e.g. will give back what is matched by the expression
    enclosed in the first set of parentheses (counted from the left)

    “n” are used for a backreference within an search pattern.
    E.g. to match double chars like “(.)1” to match “support”.
    That way the search pattern is extended by the way
    with the match of the expression to find it two times.

    “n” can also be used to refer to an match in the find
    AFTER it is done, for an use in the replacement like
    Find: “(d)” Replace: “the number is 1”

    $n

    “$n” OTOH was introduced by Perl and is an VARIABLE
    which holds the match of an expression after the find is done.
    “$n” can be seen here as an synonym of “n”. But only in the replacement.

    Recapitulation

    This days it seems to depend of the used regex engine (or maybe on the coder of the app?)
    which flavor is used to represents an backreference
    in the REPLACEMENT: 1 or $1 can be used.

    But for the backreference in the SEARCH string i think always 1 is used.

    It seams EmEditor (using the Boost library) does the same.
    1 is allowed in the FIND only (no $1 here)
    but 1 AND $1 are both allowed in the replacement field.

    .

    in reply to: replace string in placeholder ($1)? #10295
    Stefan
    Participant

    That’s not possible. You have to change your how-to.

    Use a more granular expression to capture the text and the digit into two separate capture groups.
    Then you have the possibilities on the replacement as you want.

    in reply to: Vi/Vim command mode #10202
    Stefan
    Participant

    Just browse the Library here on the right side…

    in reply to: Snippet: allow to Copy & Paste an Item #10162
    Stefan
    Participant

    1b. is implemented now too:

    Posted on: 3/8/2012 12:55 am
    Head-start version: EmEditor Professional v11.1.3 beta
    – (Snippets plug-in) Drag and drop on the Snippet tree
    while pressing the CTRL key can copy items now.

    Thank you Yutaka.

    in reply to: Snippet: drag&drop lines to new item, limit "Name" length #10161
    Stefan
    Participant

    Stefan wrote:

    Drag&Drop leads to an empty snippet for me ?!

    emed32_11.1.2_beta.exe on XP SP3

    D&D works again as intended
    and the [Name: ] -string is cut down now as suggested at 80 signs
    with:

    Posted on: 3/8/2012 12:55 am
    Head-start version: EmEditor Professional v11.1.3 beta

    Thank you!

    Stefan
    Participant

    Drag&Drop leads to an empty snippet for me ?!

    emed32_11.1.2_beta.exe on XP SP3

    I installed emed32_11.1.2_beta.exe
    and then chose import/export to ini.

    Then enabled snippet plugin
    and drag a few selected lines to the snippets
    and as result i got an new item symbol
    but without any text/content.

    Today, (2/28/2012) we are releasing EmEditor Professional v11.1.0 beta.
    Updates from v11.0.5 include:
    NEW FEATURES

    – (Snippets plug-in) The title of a snippet is now automatically cut off at 79 characters long when text is imported by drag-and-drop from the text area or another application.

    in reply to: Snippet: allow to Copy & Paste an Item #10117
    Stefan
    Participant

    1a. is done for single selected item or folder.
    Selecting more then one item/folder is not possible.

    1b. is not implemented

    Thank you Yutaka.

    Today, (2/28/2012) we are releasing EmEditor Professional v11.1.0 beta.
    Updates from v11.0.5 include:
    NEW FEATURES
    – (Snippets plug-in) The Cut (Ctrl+X), Copy (Ctrl+C), and Paste (Ctrl+V) commands were added to the Snippets plug-in.
    These commands can be used to copy or move snippets items easily around the snippet tree.
    The Paste command can be also used to insert a simple text snippet to the snippet tree.

    EDIT:
    Be aware: the snippet copy is an exactly 1:1 copy
    including all parameters as f.ex. trigger and shortcut.

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

    I think the hover tool tips are an great improvement.
    Many thanks Yutaka.

    Now we can use an abstract snippet description like “my funny snippet”
    and can see in the tool tip what the snippet will do exactly.

    Today, (2/28/2012) we are releasing EmEditor Professional v11.1.0 beta.
    Updates from v11.0.5 include:
    NEW FEATURES
    – (Snippets plug-in) The Snippets text is now displayed as a tooltip when the mouse hovers on an item of the Snippets tree (Context menu – View – Tooltip must be checked in order to enable this feature).

    Note:
    Only English, Japanese, and Korean user interfaces are up-to-date.
    “View – Tooltip” is not available e.g. in my localized german language file right now.
    So, at least for the time to enable the tooltips, use the english language.

    in reply to: number the lines #10086
    Stefan
    Participant

    a) make an zero-width selection in front of the lines
    b) execute “Edit > Advanced > Numbering…”
    c) press [OK]
    Note: to pad with zeros enter them into the “First Line” field like “01” or “0001”

    d) while still have that inserted numbers selected do an regex s&r:
    Find: (dd)
    Replace with: 1)

    [X]Use regex
    [X]In selection only

    Note: the amount of find “d” patterns depends on how many zeros you have padded.
    “dd” will match two digits.
    “ddd” or “d{3}” will match three, and so on…

    in reply to: Default open and save directories #10075
    Stefan
    Participant

    Not really as “default” but maybe this will help you:

    Tools > Customize… > [File]
    “[X]Remember Last Folder” check box

    In Open and Save As dialogs, show the previously used folder.

    in reply to: -= Tags =- #10066
    Stefan
    Participant

    I have not tested this feature

    but i had the meaning it works like this:

    * execute an Find in Files command for an “word”

    * you get an result like:
    C:File1.txt Line 3 in this line is the word
    C:FileB.log Line 25 here is this word too

    * select an line and use “Edit > Advanced > Tag Jump”
    this command will open the file and jump to the line number in question.

    Maybe you can try it yourself?

    in reply to: -= Tags =- #10064
    Stefan
    Participant

    What do you mean by “tags” ?

    Where have you read about tags?

    Maybe:

    Tag Jump command

    Summary
    Jumps to a tag.

    Description
    This command is used after running the Find in Files command, or for parsing an error log to locate a string or an error. If a file’s path and a line number are displayed at the start of a line, this command will open the file and jump to the line number in question.

    How to Run
    Default Menu: Edit > Advanced > Tag Jump

    in reply to: Error On popupmenu.GetText(-1) #10061
    Stefan
    Participant

    Hi LTT,

    why can you get negative numbers?

    I think you self add this numbers to your menu
    and take care to use positive nbr only?

    Here is my PopUp menu example (click)

    And in your code you can check for negative nbr and just “break;”

    OTOH:
    MyMenu.Add(“Execute Function &one”,-1);
    gives me no error on EmEditor 11.0.3, portable, XP SP3
    It just do nothing, or, if the case-label exists, it works with “-1” too.

    EDIT:
    Ah, now i see…

    alert( MyMenu.GetText( -1 ) );
    did not work for me too. Unknown error.

    alert( MyMenu.GetText( 2 ) );
    works.

    in reply to: GetLine Method get selected text only??? #10050
    Stefan
    Participant

    Your answer implies that GetLine() returns the whole line already.

    That was not clear to me because i saw different results (to my failure as i see now)

    Today i saw by an another test that GetLine() returns the whole line indeed:


    #language = "VBScript"

    'Returns the line number of the top of the selection.
    SelLineFirst = document.selection.GetTopPointY( eePosView )

    'Returns the line number of the bottom of the selection.
    SelLinesLast = document.selection.GetBottomPointY( eePosView )


    For LineNumber = SelLineFirst to SelLinesLast

    'Retrieves the text on the specified line "LineNumber"
    Line = document.GetLine( LineNumber )

    'Show line content:
    alert Line

    'here is my failure
    'document.selection.Text = newtext & Line

    Next 'LineNumber

    Now that i know that GetLine() returns the whole line content
    i know i did something wrong.

    My problem was that i wanted not to select the whole lines
    (in front of executing my script)
    but start selection at some signs behind SOL at first line
    and end at some position before EOL at the last line.

    BUT then, silly me, i used document.selection.Text = newtext
    and was wondering why GetLine() didn’t returns the whole line,
    now i see i was to silly to get what happens… sorry.
    (only the selected text was altered, of course)

    No i use something like

    For LineNumber = SelLineFirst to SelLinesLast

    'Retrieves the text on the specified line "LineNumber"
    Line = document.GetLine( LineNumber )

    'Selects a line at the cursor.
    document.selection.SelectLine

    'overwrite this line with new text
    document.selection.Text = newtext & Line

    Next 'LineNumber

    The additional document.selection.SelectLine
    extends at real time the selection to the whole line
    and so my replacement replaces the whole line as wanted.

    Issue solved.
    Thanks Yutaka! Thank you for your endurance and support!

    in reply to: user input in a FindInFiles macro #10039
    Stefan
    Participant

    VBScript “InputBox()” is missing

    but there is no EmEditor help entry
    pointing to the alternative “Prompt()” command

    like there is one for the missing “MsgBox()” function to alert().

    May i ask to add such an cross reference to make it
    more easy to find the InputBox alternative Prompt() ?

    2.)
    also i want to suggest an third prompt() parameter.

    As addition to
    strMessage
    strDefault

    i want to ask for
    strTitle

    like the VBS inputbox() have:

    strAnswer = prompt( strMessage, strTitle, strDefault )

    Thank you.

    in reply to: -= Text Alignment =- #10038
    Stefan
    Participant

    FROM:


    erfqlqbf ; qlkhflkejf
    kqrjhfkjrkjf ; qkhkhfg
    jreh ; kejrhfgkjh

    TO:


    erfqlqbf ; qlkhflkejf
    kqrjhfkjrkjf ; qkhkhfg
    jreh ; kejrhfgkjh

    USE:
    Edit > Separated Values/Sort
    CSV (Comma-separated), TSV (Tab-separated) or DSV (User-defined delimiter-separated)
    See: http://www.emeditor.com/modules/feature1/rewrite/tc_35.html#csv

    It was a bit difficult to me to find how to set the User-defined delimiter.
    Therefor go to Tools > Properties > [File] > Delimiter [;]

    Yutaka, I think there should be an link in the menu
    “Edit > Separated Values/Sort > Set User-defined delimiter…”

    But we can’t make this alignment stand forever.
    Once we leave this CSV mode, the alignment is lost.

    I already have asked for an improvement there:
    http://www.emeditor.com/modules/newbb/viewtopic.php?topic_id=1856&forum=4

    .

    in reply to: Need help on setting syntax highlight with RegEx #10012
    Stefan
    Participant

    Don’t know. Seems to work for me.

    EmEditor 11.0.5, 32-bit, Boost 1.47

    What’s the differences?

    in reply to: Java Script Help #10008
    Stefan
    Participant

    EmEditor Help – EmEditor Macro Reference – Tutorial > Using Regular Expressions

    EmEditor Help – How to – Search > Regular Expression Syntax

    in reply to: Java Script Help #10003
    Stefan
    Participant

    Yes i do it the same way:


    #title = "Enclose selection";
    #tooltip = "Enclose an selection with an sign";
    // Select some text and execute this macro to put an sign
    // in front and at the end of the selected text;

    //mySign = "\%"
    mySign = prompt( "Enter sign to enclose selection:", "\%" );

    selText = document.selection.Text;
    outText = mySign + selText + mySign;


    //alert(outText);
    document.selection.Text = outText;

    Should be easy to modify this code
    and replace mySign with LeadingSign and TrailingSign :-)

    in reply to: Snippet: allow to export an single item only #9988
    Stefan
    Participant

    WOW thanks, that really works! :lol:


    <?xml version="1.0"?>
    <!--EmEditor Snippets file-->
    <Snippets>
    <SnippetTree>
    <Item Name="h1" Flags="4" ConfigEdit="" ConfigMacro="" ConfigsAssociate="" Text="<h1>${0:${SelText}}</h1>
    " Trigger="h1" Tip="" ShortcutKey="0" ShortcutVirt="0"/>
    </SnippetTree>
    </Snippets>

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

    Thank you. I just wanted to know if there is a future ;-)

    Till then.

    P.S. i am sorry for having misspelling your name. Corrected!

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

    Hi Yutaka,

    i have taken a lot of time to provide you a few ideas to improve the snippets plugin,
    also because i use it often and missed that features myself.

    But unfortunately i never got an answer if this are good
    ideas or not and if they will be implemented or not.

    Would be courteously to give back an feedback.

    Can you tell if you will improve snippets plugin and, if yes,
    which idea will be implemented and for when can be an update awaited.

    If you have any question about my suggestion don’t hesitate to ask.

    Thank you.

Viewing 25 posts - 276 through 300 (of 345 total)