Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 8.3k Views 2 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            Thanasis Palianopoulos
            last edited by

            thank you
            that worked fine!!!

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors