我正在尋找一種方法在AutoHotkey中將當前訪問的URL放入一個變量中。如何使用AutoHotKey腳本獲取當前的瀏覽器URL?
這個AHK的目標是跟蹤我一天中在做什麼來更好地記錄我的小時數。我有另一個系統用來記錄我的工作,但有時我忘記了當我側重跟蹤時使用它。
loop
{
; Get current Window ID & Name
WinGet, active_id, ID, A
WinGet, process_name, ProcessName, A
; Only do anything if any other windows was activated
if(active_id = PrevActiveId)
{
; Do nothing
}
else
{
; Format the time-stamp.
current=%A_DD%/%A_MM%/%A_YYYY%, %A_Hour%:%A_Min%
; Write this data to the log.txt file.
fileappend, %current% - %process_name%`n, log.txt
; Get the URL if process_name = "chrome.exe"
if(process_name = "chrome.exe")
{
; Put URL in log file
; fileappend, %current% - %current_url%`n, log.txt
}
}
PrevActiveId = %active_id%
Sleep, 100
}
解決了它,但「聲譽低於100的用戶在詢問後8小時內無法回答自己的問題,您可以在5個小時內自行回答。」所以會在5小時內回覆..... :-( – masterdam79 2011-06-08 09:28:51
好主意在5小時內回來併發布您的答案。它可以幫助其他人:) – ardavis 2011-06-15 01:08:23