Viewing 1 post (of 1 total)
  • Author
    Posts
  • #6313
    Stefan
    Participant

    Enclose an selection with an sign (VBScript)

    Provided “as is”. No guaranty.
    Test first on non important documents! I am no programmer.
    Please comment below how it works.

    See EmEditor Help for how to use macros. Here’s an short help:
    1.) Save the code between 8< and >8 -lines as text file “somename.vbee” in EmEditor folder
    2.) use Menu “Macros > Select…” and choose this somename.vbee as current default macro
    3.) select some text or an word in your document (try first on an test document!)
    4.) press F4
    5.) you are prompted for an sign to put in front and after the selection.
    Insert one sign and press [OK]
    Your done.

    ———–8<---------------8<-----------


    #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 = prompt( "Enter sign to enclose selection:", "\%" )
    'mySign = "\%" 'alternative if you didn't wanna be prompted
    selText = document.selection.Text
    selText = mySign + selText + mySign
    'alert selText
    document.selection.Text = selText

    ———–>8—————>8———–

    Enjoy
    Stefan

    Comments and improvement suggestion welcome.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.