Dreamweaver ColorPicker 1click invoke
Helps accessing Windows ColorPicker (that big dialog).
Works for color attribute properties listed in the CSS Styles panel.
MiddleButton or
Alt-Left mouse button on the list item to invoke.
Eliminates 3 clicks, 3 *precise* mouse movements, positions color picker window right where your mouse is thus not obscuring the main window.
Tested with Dreamweaver8
First version.
Code:
#ifwinactive ahk_class _macr_dreamweaver_frame_window_
MButton::
!LButton::DreamweaverColorPicker()
#ifwinactive
DreamweaverColorPicker()
{
CoordMode,mouse,relative
MouseGetPos,mx,my,,ctl
ControlGetPos,cx,cy,,,%ctl%
ifInString,ctl,SysListView
{ sendmessage,0x101D,0,0,%ctl% ;LVM_GETCOLUMNWIDTH=LVM_FIRST+29=0x101D
colwd=%ErrorLevel%
ifLessOrEqual,colwd,0 ;bad winapi response
{ traytip,,Cannot get first column width!
return
}
MouseClick,L,% cx+colwd+8, %my%, 1, 0
}
else
ifInString,ctl,Button
MouseClick,L,% cx+4, % cy+4, 1, 0
else
return
WinWaitActive,ahk_class #32770,,1
ifNotEqual,ErrorLevel,0,return
sleep,100
MouseClick,L,180,8,1,0
WinWait,Color ahk_class #32770,,1
ifNotEqual,ErrorLevel,0,return
WinGetPos,x,y,pw,ph
mx-=pw/2, mx:=(mx<A_ScreenWidth-pw) ? mx : A_ScreenWidth-pw
my-=ph/2, my:=(my<A_ScreenHeight-ph) ? my : A_ScreenHeight-ph
WinMove,,,%mx%,%my%
}