Jump to content

Some Cyberslug Scraps


CyberSlug
 Share

Recommended Posts

; A collection of clipboard utilities.
; 8 March 2004 - CyberSlug
;
; I assume that Ctrl+C and Ctrl+V perform Copy and Paste, respectively,
;    in the active application.
; Note:  The only reason for 'Send("{ShiftDown}{ShiftUp}")'
;    is to prevent a potential bug caused by running AutoSense 1.0....

HotKeySet("^+c", "append")  ;Ctrl+Shift+C
HotKeySet("^+v", "replace") ;Ctrl+Shift+V
HotKeySet("^+x", "clear")   ;Ctrl+Shift+X

While 1
   sleep(100)
WEnd


;--------------------------------------------------
; Clipboard "Append" Utility
; Appends linefeed plus selected text to clipboard.
;--------------------------------------------------
Func append()
   Send("{ShiftDown}{ShiftUp}") ;clear the Shift state [optional]

   Local $contents = ClipGet()
   
   Send("^c")
   
   If $contents <> "" Then ClipPut( $contents & @CRLF & ClipGet() )
EndFunc


;-------------------------------------------
; Clipboard "Replace" Utility
; Swap higlighted text with clipboard text.
;-------------------------------------------
Func replace()
   Send("{ShiftDown}{ShiftUp}") ;clear the Shift state [optional]

   Local $itemOne = ClipGet()

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

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

   ClipPut($itemTwo)
EndFunc


;--------------------------------------------------
; Clipboard "Clear" Utility
; Clear the clipboard and free up memory!
;--------------------------------------------------
Func clear()
   ClipPut("")
EndFunc

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

  • 3 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...