Autoselect last pasted text in Ms word - causing fastkeys to crash

Suggestions, feature requests and bug reports.
Post Reply
prasad383
Posts: 19
Joined: Oct 18th, ’19, 14:43

Post by prasad383 » Jan 24th, ’20, 10:08

I wanted to be able to auto-select the last pasted text in ms word. I found this script which works, but somehow it causes fastkeys to crash. Fastkeys is not able to reload after I use this shortcut, it shows "cannot close previous instance of this script" error.
Is there something wrong in following script.. Thanks in advance..

shortcut -

^v with hook option.

Type command -

sleep, 100
oWord := ComObjActive("Word.Application")
sleep, 100
Range := oWord.selection.range
sleep, 100
Range.paste
sleep, 100
Range.select
return
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jan 29th, ’20, 13:21

What if you add this at the end of the script?

Code: Select all

oWord:=""
Range:=""
prasad383
Posts: 19
Joined: Oct 18th, ’19, 14:43

Post by prasad383 » Jan 30th, ’20, 06:00

Thanks a lot. It works flawlessly and fastkeys doens't crash now.
Post Reply