-
Notifications
You must be signed in to change notification settings - Fork 121
/
FcnLib-Opera.ahk
57 lines (49 loc) · 1.31 KB
/
FcnLib-Opera.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include FcnLib.ahk
;a more specialized version of runprogram("opera")?
RunOpera()
{
oldPath=C:\Program Files\Opera\opera.exe
newPath=C:\Program Files (x86)\Opera\opera.exe
if FileExist(oldPath)
Run, %oldPath%
else if FileExist(newPath)
Run, %newPath%
;TODO kill users command
ForceWinFocus("ahk_class (OperaWindowClass|OpWindow)", "RegEx")
if ForceWinFocusIfExist("Cannot start Opera")
{
while ProcessExist("opera.exe")
ProcessClose("opera.exe")
}
if ForceWinFocusIfExist("Welcome to Opera ahk_class (OperaWindowClass|OpWindow)", "RegEx")
{
Send, {ENTER}
ForceWinFocus("ahk_class (OperaWindowClass|OpWindow)", "RegEx")
}
}
CloseAllTabs()
{
ForceWinFocus("ahk_class (OperaWindowClass|OpWindow)", "RegEx")
Send, ^w
Sleep, 100
while (WinGetActiveTitle() != "Speed Dial - Opera")
{
Send, ^w
Sleep, 100
}
if (WinGetActiveTitle() == "Downloads - Opera")
Send, ^w
}
GoToPage(url)
{
if (url = "known")
url=http://dl.dropbox.com/u/789954/KnownTitle.html
ForceWinFocus("ahk_class (OperaWindowClass|OpWindow)", "RegEx")
Send, !d
Sleep, 100
Send, %url%
oldTitle:=WinGetActiveTitle()
Send, {ENTER}
WinWaitActiveTitleChange(oldTitle)
Sleep, 500
}