Sign in to follow this  
Followers 0
CyberSlug

Neat use for HotKeySet

2 posts in this topic

#1 ·  Posted (edited)

Note: HotKeySet should be available in AutoIt 3.0.85

Works if the application supports Ctrl+C copy and Ctrl+V paste...

EDIT: Microsoft Word does not like the Ctrl+Alt shortcut, so you may want to use "#v" (Winkey+V) instead.

;-------------------------------------------
; Clipboard "Replace" Utility
; Swap higlighted text with clipboard text
;-------------------------------------------

HotKeySet("^!v", "replace");Ctrl+Alt+V keyboard shortcut  
While (1)
    sleep(500);to prevent maxing-out the CPU
WEnd

Func replace()
    $itemOne = ClipGet()

    Send("^c")
    $itemTwo = ClipGet()

    ClipPut($itemOne)
    Send("^v")

    ClipPut($itemTwo)
EndFunc
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites



Yea, this new feature will provide many uses. Like your own stored clipboard.

;-------------------------------------------
; Clipboard "Multi" Utility
; Place several items into clipboard for future use.
$x=1
dim $clip[100]
HotKeySet("^!c", "add");Ctrl+Alt+C keyboard shortcut  
HotKeySet("^!v", "place");Ctrl+Alt+V keyboard shortcut  

While (1)
sleep(500);to prevent maxing-out the CPU
WEnd

Func add()
Send("^c")
$x=$x+1
$clip[$x]= ClipGet()
EndFunc

Func place()
$title = WinGetTitle("", "")
$test= InputBox("Stored Clipboard activated.", "Which memory location out of "&$x-1, "", "", -1, -1, 0, 0)+1
winactivate($title)
if int($test)>1 and int($test)<=$x then 
Clipput($clip[$test])
send("^v")
;msgbox(1,"Info", "Clipboard "&$test &" loaded into memory")
endif
EndFunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0