Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- F1::runOrActivate("Google Translate", "translate.google.com", "MyFirstName (Person 1)")
- F2::runOrActivate("Google Translate", "translate.google.com", "Person 2")
- runOrActivate(title, url, profile)
- {
- path := "4.1.1.1.1.1.1" ; Tab group
- WinGet windows, List, ahk_exe chrome.exe
- loop % windows
- {
- hWnd := WinExist("ahk_id" windows%A_Index%)
- winAcc := Acc_ObjectFromWindow(hWnd, 0)
- winTitle := Acc_Get("Name", 4,, winAcc)
- winProfile := StrSplit(winTitle, " - ").Pop()
- if (winProfile != profile)
- continue
- loop % Acc_Get("ChildCount", path,, winAcc)
- {
- tabTitle := Acc_Get("Name", path "." A_Index,, winAcc)
- if !InStr(tabTitle, title)
- continue
- WinActivate
- WinWaitActive
- if A_Index <= 8
- Send % "^" A_Index
- else
- {
- p := Acc_Get("location", path "." A_Index,, winAcc)
- RegExMatch(p, "x(\d+) y(\d+)", p)
- CoordMode Mouse, Window
- MouseGetPos x, y
- MouseMove % p1 + 20, % p2 + 10, 0
- Click
- MouseMove % x, % y, 0
- }
- return
- }
- }
- Run % "chrome.exe --profile-directory=""" profile """ """ url """"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement