我正在寻找一种方法在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