Community
    • Login

    how to run a notepad++ macro from vbscript or powershell?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 7.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Thanasis PalianopoulosT
      Thanasis Palianopoulos
      last edited by

      I 'm trying to run a vbscript and to open notepad++ , open a txt file and run a macro that i have allready made.

      is that possible?

      Thanx

      Thanasis

      1 Reply Last reply Reply Quote 0
      • Thanasis PalianopoulosT
        Thanasis Palianopoulos
        last edited by

        till now I have this…

        Dim objShell
        Set objShell = WScript.CreateObject( “WScript.Shell” )
        objShell.run(“notepad++.exe <path\name.txt>”)
        Set objShell = Nothing

        but I dont know how to run the macro command

        1 Reply Last reply Reply Quote 0
        • YaronY
          Yaron
          last edited by Yaron

          Hello Thanasis,

          1. Assign a shortcut to your macro via Settings -> Shortcut Mapper -> Macros.
          2. Add the following lines to the script.
          objShell.run...
          WScript.Sleep(100)    ' Let NPP load and open the file. Adjust the number of milliseconds to your machine.
          objShell.SendKeys("^+9")    ' "^+9" is Ctrl+Shift+9. Replace it with your preferred shortcut. 
          

          Best regards.

          1 Reply Last reply Reply Quote 0
          • Thanasis PalianopoulosT
            Thanasis Palianopoulos
            last edited by

            thank you
            that worked fine!!!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors