topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday October 13, 2024, 11:05 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Req - Clickable Tooltips for Pasting  (Read 3219 times)

Smobu

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 51
    • View Profile
    • Donate to Member
Req - Clickable Tooltips for Pasting
« on: July 30, 2009, 07:28 PM »
Clickable Tooltips for Pasting

I was hoping tha someone could modify this script to make it so that the tooltips are allowed to paste when they are clicked upon.
The windows key and v key are used to cycle through the entries that were copied earlier. I use this to mainly copy text and rename files easier.
The reason that I use this script as opposed to others is that this script does not steal the focus for renaming files.

Code: AutoIt [Select]
  1. clip_index = 0
  2. clip_max = 5
  3. clip_1 = Text
  4. clip_active = 1
  5.  
  6. CoordMode, tooltip, screen
  7.  
  8. goto clip_end_label
  9.  
  10. OnClipboardChange:
  11. if clip_active
  12.         addClip(clipboard)
  13. clip_active = 1
  14.  
  15. addClip(text)
  16. {
  17.         global
  18.         if text =
  19.                 return
  20.         local old
  21.         old := clip_%clip_index%
  22.         if  old = %text%
  23.                 return
  24.         clip_index := mod(clip_index+1,clip_max)
  25.         clip_%clip_index% = %text%
  26. }
  27.  
  28. #V::
  29. clip_tmp=1
  30. v_was=1
  31. loop
  32. {
  33.         Loop %clip_max%
  34.         {
  35.                 index := mod(clip_max+clip_index-A_Index+1,clip_max)
  36.                 element := clip_%index%
  37.                 element := ShortenClip(element)
  38.                 i1 := A_Index+1
  39.                 if element
  40.                         ToolTip, %element%, 30+60*(A_Index=clip_tmp), 60*A_Index-50,i1
  41.         }
  42.         res := GetKeyState("LWin","P")+GetKeyState("RWin","P")
  43.         esc__ := GetKeyState("Escape","P")
  44.         if (res=0)
  45.                 break
  46.         if (esc__=1)
  47.                 break
  48.         res := GetKeyState("V","P")
  49.         if res=1
  50.                 if v_was=0
  51.                 loop
  52.                 {
  53.                         clip_tmp := 1+mod(clip_tmp,clip_max)
  54.                         index := mod(clip_max+clip_index-clip_tmp+1,clip_max)
  55.                         element := clip_%index%
  56.                         if element
  57.                                 break
  58.                 }
  59.         v_was := res
  60.         Sleep, 50
  61.         }
  62. Loop %clip_max%
  63. {
  64.         i1 := A_Index+1
  65.         ToolTip, , , , i1
  66. }
  67. if (esc__=1)
  68.         return
  69. index := mod(clip_max+clip_index-clip_tmp+1,clip_max)
  70. clip_active =
  71. clipboard := clip_%index%
  72. Send, ^v
  73.  
  74. ShortenClip(text)
  75. {
  76.         Loop, Parse, text, `n
  77.         {
  78.                 StringLeft, outline, A_LoopField, 40
  79.                 out = %out%%outline%`n
  80.                 if A_Index>2
  81.                 {
  82.                         out = %out%.....
  83.                         break
  84.                 }
  85.         }
  86.         return out
  87. }
  88.  
  89.  
  90. clip_end_label:
« Last Edit: July 30, 2009, 07:31 PM by Smobu »