Can AHK copy to clipboard the webpage title and url in markdown format? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
cadudesun
Posts: 111
Joined: 04 Jun 2016, 10:26

Can AHK copy to clipboard the webpage title and url in markdown format?

10 Feb 2020, 19:42

Hi,

I'd appreciate your assistance.

For the webpage "https://www.autohotkey.com/" loaded on Google Chrome, can I trigger an AutoHotkey script to copy the webpage title and url in markdown format?

The expected result would be:

[AutoHotkey](https://www.autohotkey.com/)

Thank you very much!
nou
Posts: 26
Joined: 24 Feb 2019, 21:21

Re: Can AHK copy to clipboard the webpage title and url in markdown format?

10 Feb 2020, 23:55

Yes. It can.

You can use WinGetTitle or something to get the title.

You can google "Get current URL with AHK".

Then you can use the "Send" command to type whatever you need, however you need.
User avatar
Yakshongas
Posts: 591
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: Can AHK copy to clipboard the webpage title and url in markdown format?

11 Feb 2020, 09:55

I think this is what you are asking for.

Code: Select all

F1::
SendEvent, {Control Down}
SendInput, l
Sleep, 200
SendInput, c
SendEvent, {Control Up}
WinGetActiveTitle, Titulo
Run, Notepad.exe
Sleep, 300
SendRaw, [
Send, %Titulo%
SendRaw, ]
Send, {Space} (
Send, %clipboard%
SendRaw, )
SendEvent, {Control Down}
Send, e
Send, c
SendEvent, {Control Up}
WinKill, ahk_exe Notepad.exe
Sleep, 450
SendInput, n
MsgBox, Copied %clipboard%
return

Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
teadrinker
Posts: 1901
Joined: 29 Mar 2015, 09:41
Contact:

Re: Can AHK copy to clipboard the webpage title and url in markdown format?  Topic is solved

11 Feb 2020, 10:13

@Yakshongas, no, no, no! As you like, but not like this! :shock:

Code: Select all

#If WinActive("ahk_class Chrome_WidgetWin_1 ahk_exe chrome.exe")
$F1::
   Clipboard := ""
   Send ^l
   while !Clipboard {
      Sleep, 50
      Send ^c
   }
   Send {End}
   WinGetActiveTitle, title
   Clipboard := "[" . title . "](" . Clipboard . ")"
   MsgBox, % Clipboard
   Return
User avatar
Yakshongas
Posts: 591
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: Can AHK copy to clipboard the webpage title and url in markdown format?

11 Feb 2020, 11:00

@teadrinker
Lol your Script looks smooth AF!
I still have so much to learn, :crazy:
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
cadudesun
Posts: 111
Joined: 04 Jun 2016, 10:26

Re: Can AHK copy to clipboard the webpage title and url in markdown format?

11 Feb 2020, 13:21

Thanks all for the replies!
The last script deliveries exactly what I was looking for.

Return to “Ask For Help”

Who is online

Users browsing this forum: AshleyM0101, Batsmaru0410, Bing [Bot], Frosti, Lee James, mikagenic, mikeyww and 43 guests