1

I have a simple one line run script in Notepad++ that sends the output of a Powershell script to the clipboard. I'm trying to send the output directly to the current cursor position in the current file. Yes, just to save a keyboard stroke... I'm using the "Run > Run..." menu option.

Note: The version of Notepad++ I'm using is 7.5.1 (64bit)

    powershell.exe $("Set-Clipboard '------------------------------------------------------' ; Get-Date -Format 'yyyy-MM-dd hh:mm tt' | Set-Clipboard -Append")
Glenn Wark
  • 1,499
  • 4
  • 19
  • 23
  • Of course, if anyone has a better way to add a date stamp to this version of Notepad++, please let me know. – Glenn Wark Dec 29 '22 at 18:15
  • 1
    Maybe a plugin would be a better way to do it. This would allow you to insert text directly, without destroying clipboard content. There is "Automation Scripts" plugin which provides a way to write plugins in C# script, but I haven't tried it. – zett42 Dec 29 '22 at 20:44
  • Good idea, unfortunately we can't install any plugins at my place of work. Apologies, I should have mentioned that in the question. Maybe I'll give it a go at home. – Glenn Wark Dec 29 '22 at 22:36
  • 1
    My workplace now allows VSCode to be used. User snippets are awesome. As an aside, it's so nice to have a more 'standard' regex flavour. – Glenn Wark Feb 16 '23 at 16:33

0 Answers0