What I want to do is have a copy of the active page title and page URL copied into a notepad text document or GUI with links. .
I have little experience with AHK I have made a few simple apps, but I don't know how to make this or where to begin.
I started to make a GUI just to give you guys some inspiration and visual idea of what I am working on.
Can AHK Copy page title and url?
Re: Can AHK Copy page title and url?
Example for browser Firefox
you can add also an input before write to file
use a listview to read the file , click then column-2 to start url
you can add also an input before write to file
use a listview to read the file , click then column-2 to start url
Code: Select all
;- for Mozilla Firefox , copy TITLE and URL from active TAB
;-----------------------------------------------------------
;- MODIFIED = 20190505
;- CREATED = 20190505
;---------------------
#warn
#NoEnv
DetectHiddenWindows, Off
SetTitleMatchMode, 2
return
;- key win+7
$#7::
KeyWait p
SetTitleMatchMode, 2
If (WinID := WinExist("A")) ;- active window
{
f1=%a_desktop%\Title_Url_Copied.txt
WinGetTitle, Title, ahk_id %WinID%
if title contains Mozilla
{
xxc:=" - Mozilla Firefox"
stringreplace,title,title,%xxc%,,all
url :=""
Clipboard:=""
sleep,200
sendinput,!s ;- alt+s copies url in mozilla firefox
sleep,1000
sendinput, ^c{right}
sleep,500
clipwait,
URL:=clipboard
; InputBox, UserInput, comments
; if errorlevel<>0
; return
FileAppend,%Title% `;%url%`r`n,%F1%
Splashimage,,b w900 h150 x100 Y400 CWsilver m9 b fs10 zh0,%title%`n%url%
Sleep,900
Splashimage, off
run,%F1%
url :=""
Clipboard:=""
return
}
return
}
return
esc::exitapp
Re: Can AHK Copy page title and url?
There's code here to get the title/url for the active tab in Firefox/Chrome:
Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947
There's code here to get the titles/urls for all tabs in Internet Explorer:
jeeswg's Internet Explorer and HTML tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=31766
Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947
There's code here to get the titles/urls for all tabs in Internet Explorer:
jeeswg's Internet Explorer and HTML tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=31766
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Can AHK Copy page title and url?
jeeswg, thank you for the examples also for chrome and internetexplorer
Re: Can AHK Copy page title and url?
Hey garry,
Thanks to you, I managed to capture name of an active browser card (or any active window):
Here you can copy URL:
Thanks to you, I managed to capture name of an active browser card (or any active window):
Code: Select all
!F3::
DetectHiddenWindows, Off ;I don't know whether it's required
SetTitleMatchMode, 2 ;I don't know whether it's required
If (WinID := WinExist("A")) ;- active window
{
WinGetTitle, Title, ahk_id %WinID% ;title of a window or active browser card
;Clipboard := title
if title contains Mozilla ;cut Mozilla in the name
{
xxc:=" - Mozilla Firefox"
stringreplace,title,title,%xxc%,,all
}
Clipboard:=title
}
return
Code: Select all
#F3::
sendinput,{F6}
Sleep 25
sendinput,^c
return