I guess i'm not the ony one. All the time wanting to copy that particular CLIP among myriads of them - and fast.
Let me create a folder (named for example "clipfiles") in my data-drive. And inside i create some .txt files containing clips. Why .txt files? - because notepad starts real fast, but it can be text-files of some other application. In a 'html.txt' file i put html-code-clips, in 'css.txt' css-code-clips, in 'emails.txt' email addresses etc. etc. etc.
The script:
Code:
;ClipFiles
#singleinstance force
; FOLDER TO LOOK FOR CLIPFILES (TO ZAP WITH NOTEPAD)
whichfolder = [put it here]
; BUILD GUI TO CHOOSE CLIPFILE
loop, %whichfolder%\*.txt
{
file%A_Index% = %A_LoopFileName%
num = %A_Index%
}
str =
loop, %num%
{
tmp := file%A_Index%
str = %str%|%tmp%
}
sort, str, D|
gui, font, s9, Tahoma
gui, color, red
gui, add, ddl, w500 gexec r40 choose2, %str%
gui, show, , ClipFile(s)
MouseClick, left, 505, 39, ,0
return
exec:
winhide A
wingetactivetitle, MyWorkWin
run %whichfolder%\%A_GuiControl%
sleep 10
Input, var, , {Esc}, ; >> USER SELECTS with mouse WANTED (CLIP)TEXT & PRESSES "Esc"
sleep 10
Send ^c
winclose A
winactivate, %MyWorkWin%
send ^v ; PASTE CLIP ON WORKING WINDOW
exitapp
; ON PRESSING Esc EXIT SCRIPT
guiescape:
guiclose:
exitapp
Use: Right now in my email client i need an email-address! I start the script with a hotkey, click on 'emails.txt', select the text i want and press Esc. Just that.
Version 2:
And even faster. I omit the initial GUI, accessing one certain ClipFile directly with one stroke:
Code:
;ClipFile
#singleinstance force
wingetactivetitle, MyWorkWin
run ahk_scripts\clipfiles\emails.txt
sleep 10
Input, var, , {Esc}, ; >> USER SELECTS with mouse WANTED CLIPTEXT & PRESSES "Esc"
sleep 10
Send ^c
winclose A
winactivate, %MyWorkWin%
send ^v ;PASTE CLIP ON WORKING WINDOW
exitapp
;ON PRESSING Esc EXIT SCRIPT
guiescape:
guiclose:
exitapp
Use: Press the hotkey, select something with the mouse, press Esc. Just that.
Enjoy! And hey i would enjoy improvements. Good ideas most wanted.
