My friend's workflow requires copying and pasting of numbers many times per day, however the numbers to be copied are rendered with spaces and the locations to paste require there to be no spaces.

Also, the company will not allow employees to download anything extra (so we can't use AutoHotKey, for example).

That said, I believe it must be possible to do this within the constraints. Maybe with Powershell?

How can we create a keybinding that will paste the clipboard's contents without whitespaces?

  • Powershell can be made to send keys with a little work so you could get the clipboard contents, trim the whitespace and then "type" it out. I don't know how you would assign your powershell script to a hotkey though.
    – Mokubai
    May 19, 2022 at 21:13
  • What is the source application where the numbers originate (eg, web page)? What is the target application (eg, MS Excel)? PowerShell is likely fully capable for this task, but there could be more streamlined options available dependending upon your app requirements. If you choose PowerShell, you can create a Windows shortcut to your script, then assign a shortkey key to that Windows shortcut.
    – leeharvey1
    May 20, 2022 at 10:45
  • The source and target are both Google Chrome. I found a Chrome extension that can accept a custom javascript function and I think this will work, however it requires my friend to right-click instead of using ctrl+c. Not ideal, but much better! Thank you for the tips on PowerShell! We will try that too.
    – calvin
    May 20, 2022 at 13:58


You must log in to answer this question.

Browse other questions tagged .