Code: Select all
; Delete history in IE11
#persistent
SetTitleMatchMode, 2
Return
#IfWinActive ahk_class IEFrame
f12::
Send, ^+{Del}
Send, d
Code: Select all
; Delete history in IE11
#persistent
SetTitleMatchMode, 2
Return
#IfWinActive ahk_class IEFrame
f12::
Send, ^+{Del}
Send, d
Or, maybe AHK sends "d" before the window is created. Try using WinWait / WinWaitActive.Krash wrote:The Send, d doesn't send.
Code: Select all
...
Send, d
return
Code: Select all
; Delete history in IE11
#persistent
SetTitleMatchMode, 2
Return
#IfWinActive ahk_class IEFrame
f12::
Send, ^+{Del}
WinWaitActive [, , Delete, 1, ,]
Send, d
Return
Code: Select all
; Delete history in IE11
#persistent
SetTitleMatchMode, 2
Return
#IfWinActive ahk_class IEFrame
f12::
Send, ^+{Del}
WinWaitActive [, , Delete, 1, ,]
Send, d
WinWait 5
Click 1111, 705, 1
Return
Code: Select all
CoordMode, Mouse, Window ; Set coordmode for when clicking the mouse
CoordMode, Pixel, Window ; Set coordmode for ImageSearch
return ; End of Auto-execute section
#IfWinActive ahk_class IEFrame
f12::
Send, ^+{Del}
WinWaitActive, Delete Browsing History ahk_exe iexplore.exe,, 1
if (ErrorLevel) ; If WinWaitActive timed out, return
return
ControlClick, Button9,,,,, NA ; Click the Delete button
WinWaitActive, ahk_class IEFrame,, 1
if (ErrorLevel)
return
WinGetPos, WinX, WinY, WinW, WinH ; Get area of the IE window
Loop, 20 ; Try to find the image 20 times before giving up
{
ImageSearch, FoundX, FoundY, 0, 0, WinW, WinH, % A_ScriptDir "\MyImage.png"
if (ErrorLevel = 0) ; Image found
{
FoundX += 10 ; ImageSearch found the top left of the image, so add an offset
FoundY += 25
MouseGetPos, MouseX, MouseY
MouseClick, L, %FoundX%, %FoundY%,, 0
MouseMove, MouseX, MouseY, 0
break
}
else if (ErrorLevel = 1) ; Image not found
Sleep, 500 ; try again in 0.5 seconds
else if (ErrorLevel = 2)
{
MsgBox, 16, ImageSearch Error,
(Join LTrim
There was a problem that prevented ImageSearch from conducting the search
(such as failure to open the image file or a badly formatted option).
)
break
}
}
return
#If
Code: Select all
Send, ^+{Del}
WinWaitActive [, , Delete, 1, ,]
Send, d
WinWait 5
Click 1111, 705, 40
Return
It means, "Look for a window named '5' and when it inevitably times out proceed with the rest of the script."derz00 wrote:Whoa, buddy, what does WinWait 5 mean? Looks scary to me...
Code: Select all
WinWait, , , 5
Code: Select all
Sleep, 5000
Code: Select all
Send, ^+{Del}
WinWaitActive [, , Delete, 1, ,]
Send, d
Sleep, 1000
Click 1111, 705, 40
Return
No. That won't work. You're doing something weird if you think that works.Krash wrote:Code: Select all
WinWaitActive [, , Delete, 1, ,]
Users browsing this forum: Araphen, mikeyww, Peiya, ShatterCoder, sofista and 300 guests