2016-07-04 25 views
0

讓我開始與我有非常小的腳本/編程知識:)關閉鉻

我的問題是,我對在運行過投影機的呼叫中心儀表盤上的網頁。該網頁位於內部Web服務器上。

網頁隨機超時並創建錯誤。

我需要關閉瀏覽器(或Firefox)當一個網頁地址更改錯誤頁面如:從localsite.local /頁面localsite.local /錯誤

我用自動IT- Au3Record和賽特,以記錄頁面超時時的鼠標點擊。

這適用於某些PC,但不是全部。是否有我可以運行的通用腳本, ,所以我不必在所有PC上記錄鼠標點擊。

當前工作的腳本

#region --- Au3Recorder generated code Start (v3.3.9.5  KeyboardLayout=00000809) --- 
#region --- Internal functions Au3Recorder Start --- 
Func _Au3RecordSetup() 
Opt('WinWaitDelay',100) 
Opt('WinDetectHiddenText',1) 
Opt('MouseCoordMode',0) 
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') 
If $aResult[1] <> '00000809' Then 
    MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00000809->' & $aResult[1] & ')') 
EndIf 

EndFunc 

Func _WinWaitActivate($title,$text,$timeout=0) 
    WinWait($title,$text,$timeout) 

    If Not WinActive($title,$text) Then WinActivate($title,$text) 
    WinWaitActive($title,$text,$timeout) 

EndFunc 

_AU3RecordSetup() 
#endregion --- Internal functions Au3Recorder End --- 

_WinWaitActivate("Website.com/site/Main_Dash_Reporting.aspx - Google Chrome","") 
MouseClick("left",1342,14,1) 

_WinWaitActivate("Program Manager","") 

MouseClick("left",282,746,1) 

_WinWaitActivate("Website.com/site/Dash_Viewer.aspx?DashID=5200&RevNum=null - Google Chrome","") 

MouseMove(702,311) 

MouseDown("left") 

MouseMove(707,310) 

MouseUp("left") 

#endregion --- Au3Recorder generated code End --- 
+1

它是如何工作的(在某些PC上)?可能是不同的屏幕分辨率? (注意:使用「主」而不是「左」也適用於左手用戶)如果可能的話,擺脫任何鼠標模擬。 Windows可以(幾乎)完全由按鍵操作。 – Stephan

+0

它似乎在Windows 7上工作,但在Windows 8.1上不太好。生病了再次擊鍵。但我希望通用嚴格的全線工作 – Kenster

回答

0

的Internet Explorer是程序員的工具。

Set objShell = CreateObject("Shell.Application") 
Set AllWindows = objShell.Windows 
For Each window in AllWindows 
    msgbox window.locationname 
    If window.locationname="Scripts" then window.quit 
Next 

這是一個vbscript。由於歷史原因,它包括Explorer和IE窗口。

另一個屬性是window.locationURL

+0

謝謝,但我需要使用鉻,系統是設計顯示在鉻。 – Kenster