Trim working randomly!
Posted: 27 May 2018, 05:22
Hi,
I want to trim Clipboard after pressing Control+C. It's quiteannoying as when I double click in a word, selection usually includes a space at the rightmost position. I want to trim the clipboard when pressing Control C.
Well, I am trying this (variations are welcome)
$^c:: ; I UNDERSTAND THIS $ SIGN IS NECESSARY TO USE THE SYSTEM CONTROL-C WITHIN THE HOTKEY. IT DOES NOT WORK WITHOUT IT.
SendInput ^c ; A SIMPLE COPY COMMAND (IT'S NOT COMPLETELY RELIABLE, I DON'T KNOW WHY, I USE VARIATIONS AS WELL)
Clipboard := Rtrim(clipboard, OmitChars := " ") ; TRIMS WHEN IT WANTS, DOESN'T TRIM A DAMN REST OF THE TIME
Return
and it works RANDOMLY. Sometimes it trims, sometimes it doesn't. Of course, I have previously tried all possible variations I can think of, both for SendInput ^c or SendInput {Control Down}c{Control Up} as for Clipboard=%Clipboard%, ClipBoard=Trim (clipboard), etc.
Of course, either it works RANDOMLY or it doesn't work at all (I suppose that happens when I use a wrong or incorrect syntax) but I have never got this to work 100% of the time!!
WHY???
I want to trim Clipboard after pressing Control+C. It's quiteannoying as when I double click in a word, selection usually includes a space at the rightmost position. I want to trim the clipboard when pressing Control C.
Well, I am trying this (variations are welcome)
$^c:: ; I UNDERSTAND THIS $ SIGN IS NECESSARY TO USE THE SYSTEM CONTROL-C WITHIN THE HOTKEY. IT DOES NOT WORK WITHOUT IT.
SendInput ^c ; A SIMPLE COPY COMMAND (IT'S NOT COMPLETELY RELIABLE, I DON'T KNOW WHY, I USE VARIATIONS AS WELL)
Clipboard := Rtrim(clipboard, OmitChars := " ") ; TRIMS WHEN IT WANTS, DOESN'T TRIM A DAMN REST OF THE TIME
Return
and it works RANDOMLY. Sometimes it trims, sometimes it doesn't. Of course, I have previously tried all possible variations I can think of, both for SendInput ^c or SendInput {Control Down}c{Control Up} as for Clipboard=%Clipboard%, ClipBoard=Trim (clipboard), etc.
Of course, either it works RANDOMLY or it doesn't work at all (I suppose that happens when I use a wrong or incorrect syntax) but I have never got this to work 100% of the time!!
WHY???