Jump to content

3 item clipboard


Guest Guest_LoneReaper

Recommended Posts

Guest Guest_LoneReaper

i have 3 items that i copy during my order processing pase of the day. customer address, email, and order #.

i want to be able to do something like this

---------------------

when ^!1

after ^c

$address = clipget ()

after ^c

$ordernumber = clipget ()

after ^c

$email = clipget ()

End When ^!1

----------------------------

what are the functions for "when" and "after" in this script? that way i have a toggle button(s) to press. how would i keep this script running in the sys tray until i exit it?

and finally, i would need to do something to paste this info in like

^!q = $address

^!w = $ordernumber

^!e = $email

how would i do that?

thanks in advanced

Link to post
Share on other sites

Did you get that working? Not sure what exactly you need, but you could try this if you like:

; CopyQ
; =====
;
; Description:
; This is a HotKey utility that enables the user to copy several
; text clippings and then paste them individually in the order in
; which they were copied.
;
; Limitations:
; For standard ASCII text. A high character is used as a separator.
;
; Notes:
; Modify the HotKeySet lines to suit yourself. Currently, the
; activation key combination is Ctrl+Win+Alt.
; Try uncommenting the SoundPlay line for aural feedback.
; Pasting cannot be rapid-fire if you retain the Display.
; By old oompah, 2004-06
;
; ====================================================================


Dim $sep
Dim $q

$sep = Chr(254)
HotKeySet("^#!c", "DoCopy")
HotKeySet("^#!v", "DoPaste")
HotKeySet("^#!r", "ResetQ")
HotKeySet("^#!{ESC}", "Quit")

ResetQ($q)
Do
  Sleep(5000)
Until 0

Exit

Func DoCopy()
    Local $item
  Send("^c")
  $item = ClipGet()
  If @error Then
    MsgBox(16, @ScriptName, "Error reading Clipboard")
  Else
     AddQ($q, $item, $sep)
    EndIf
EndFunc; DoCopy

Func AddQ(ByRef $q, $item, $sep)
    If $q = "" Then
  $q = $item
    Else
  $q = $q & $sep & $item
    EndIf
 ;SoundPlay(@WindowsDir & "\Media\ding.wav", 1)
  DisplayQ($q, $sep)
EndFunc; AddQ

Func DoPaste($q, $sep)
    Dim $item
    $item = DeleteQ($q, $sep)
    If Not @error Then
    If ClipPut($item) Then
     Send("^v")
    Else
     MsgBox(16, @ScriptName, "Error writing to Clipboard")
  EndIf
    EndIf
EndFunc; DoPaste

Func DeleteQ(ByRef $q, $sep)
    Local $item
    Local $pos
  If $q = "" Then
     MsgBox(16, @ScriptName, "Queue is empty")
     SetError(1)
  Else
     $pos = StringInStr($q, $sep)
     If $pos = 0 Then
    $item = $q
    $q = ""
     Else
    $item = StringLeft($q, $pos - 1)
    $q = StringTrimLeft($q, $pos)
     EndIf
  EndIf
    DisplayQ($q, $sep)
  Return $item
EndFunc; DeleteQ

Func ResetQ(ByRef $q)
    $q = ""
    DisplayQ($q, $sep)
EndFunc

Func DisplayQ($q, $sep)
  Dim $t
  If $q = "" Then
    SplashTextOn(@ScriptName & " - c (Copy), v (Paste), r (Reset)", _
    "(Empty)", 220, -1, 1, 1, 22)
    Else
  $a = StringSplit($q, $sep)
  For $j = 1 to $a[0]
      $t = $t & "Item: " & StringLeft($a[$j], 20) & @CRLF
    Next
    SplashTextOn(@ScriptName & " - c (Copy), v (Paste), r (Reset)", _
    $t, 220, -1, 1, 1, 22)
    EndIf
EndFunc

Func Quit()
    Exit
EndFunc

I don't know why the indentation went haywire.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...