Can I ask for some more help, now with a different script?
I want a script that will trim the trailing space of a word selected via double-clicking. I have the following simple script, which works fine when a selected word is followed by a space but has the undesired result of "trimming" the last character of a word when followed by a punctuation mark.
~LButton::SystemDoubleClickTime := DllCall("GetDoubleClickTime")
If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < SystemDoubleClickTime){ Send +{Left} }Return
I also have this, found somewhere some time ago, but even though it looks complicated, it has the same result:
~LButton::SystemDoubleClickTime := DllCall("GetDoubleClickTime")
If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < SystemDoubleClickTime){ ; Copy everything in the Clipboard oldClipboard := ClipboardAll
  ; Empty the Clipboard clipboard =  ; CTRL+ C = copy text selected Send ^c ; Wait until the Clipboard grabs the content ClipWait
  AutoTrim, Off word = %Clipboard% StringLen, len1, word
  AutoTrim, On wordWithoutSpaces = %word% StringLen, len2, wordWithoutSpaces
  IfNotEqual, len1, len2 { Sendinput +{left} ; SHIFT LEFT }
  ; Give contents back to the Clipboard Clipboard = %oldClipboard% 
  ; Free memory of temp variable oldClipboard = }Return
									
 Translate


