板 1- 前 次 新 レス
スクリプト投稿スレ
[32]28:05/01/13 20:12 ID:???
せっかくなんで自分も上げて見る
cpex_init:
cpex_Separator = `a /* セパレータ文字 */
cpex_BufMax = 10 /* バッファ数 */
Menu,cpMenu,Add
cpex=
return
;;;クリップボード監視(Ctrl+Cをフック)
$^c::
AutoTrim,OFF
StringCaseSense,ON
ClipBoard =
Send,^c
ClipWait,0.5
if ErrorLevel = 0
{
Loop,Parse,cpex,%cpex_Separator%
{
cpex_cnt=%A_Index%
if ClipBoard=%A_LoopField%
{
StringReplace,cpex,cpex,%A_LoopField%%cpex_Separator%
break
}
}
if cpex_cnt>=%cpex_BufMax%
{
StringGetPos,len,cpex,%cpex_Separator%
StringTrimRight,cpex,cpex,%len%
}
SetEnv, cpex,%ClipBoard%%cpex_Separator%%cpex%
}
return
;;;[ctrl*2] 貼り付け文字列選択MENU表示
~CTRL::
if A_PriorHotkey <> %A_ThisHotkey%, return
if A_TimeSincePriorHotkey > 400, return
WinWaitActive,A
Menu,cpMenu,DeleteAll
Loop,Parse,cpex,%cpex_Separator%
{
if A_LoopField= , continue
StringLeft,cpw,A_LoopField,20
StringReplace, cpw, cpw, %A_Tab%,...,All
StringLen,len,A_LoopField
if len>20, SetEnv,cpw,%cpw%...
Menu,cpMenu,Add,%A_Index%.%cpw%,cpMenu_SelString
}
Menu,cpMenu,Add
Menu,cpMenu,Add,Clear,cpMenu_Clear
Menu,cpMenu,Show
WinActivate
return
cpMenu_SelString:
;;貼付文字列選択
AutoTrim,OFF
Loop,Parse,cpex,%cpex_Separator%
{
if A_Index = %A_ThisMenuItemPos%
{
ClipBoard=%A_LoopField%
ClipWait,0.5
SetTimer,cpex_past,ON
}
}
return
cpex_past:
;;;選択文字列貼り付け
Send,^v
SetTimer,cpex_past,OFF
return
cpMenu_Clear:
cpex=
return
前 次