AutoHotKey script HELP please!!! Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
jaggsharry
Posts: 2
Joined: 24 Feb 2018, 08:52
Facebook: Sepribo Taylor-Harry
Google: Sepribo Taylor-Harry
GitHub: Sepribo

AutoHotKey script HELP please!!!

24 Mar 2018, 08:38

Hello AutoHotKey Experts,

I'm a newbie to autohotkey and will really appreciate any help to accomplish this requirement. Here it goes, I'm looking for a AutoHotKey script the will copy a highlighted email attachment link into Windows Run Diag (Windows Key+R) and open the email. I so far have parts of what I want working, but can't seem to get it all into one script to give the desired result. This is my requirement and what I have so far to better understand my end goal:

Requirement:

1) Highlighted email attachment link from a browser

2) CTRL + C -- to copy the email attachment link from a browser

3) Windows Key + R -- to open the Windows Run Diag

4) CTRL + V -- Paste the email attachment link into the Windows Run Diag

5) Enter -- to open the email


AutoHotKey Script:
$F10::

Send, ^c -- This command alone copy the email attachment link

ClipWait

FileDlg := ComObjCreate("Shell.Application").FileRun, FileDlg := "" -- this command alone also open the Windows Run Diag

Send, ^c {ENTER}

return


I will really appreciate any help I can get here... Thank you!
User avatar
Trogluddite
Posts: 8
Joined: 23 Mar 2018, 06:42

Re: AutoHotKey script HELP please!!!  Topic is solved

24 Mar 2018, 11:25

I can see one obvious problem (probably just a typo!), and there is something else which should make your script more reliable...

Code: Select all

$F10::

	Send, ^c
	ClipWait 

	; Your variable 'FileDlg' doesn't do anything here; the existence of the FileRun dialogue as the
	; active window is sufficient to be able to 'Send' to it.
	ComObjCreate("Shell.Application").FileRun

	; This makes the script wait until the "Run" dialogue is definitely the active window,
	; otherwise you might paste the data back where it came from. It allows the dialogue
	; one second in which to open.
	WinWaitActive, Run,, 1

	; This shows an error message and closes the script if the 'Run' dialogue didn't open,
	; which should never happen, but it's good practice to handle this kind of thing.
	; 'ErrorLevel' is an internal variable which many commands will set if they fail.
	if (ErrorLevel) {
		MsgBox The Run dialogue could not be opened
		ExitApp
	}

	; Your posted code says ^c, which I guess is not what you meant!
	Send, ^v{Enter}

return
jaggsharry
Posts: 2
Joined: 24 Feb 2018, 08:52
Facebook: Sepribo Taylor-Harry
Google: Sepribo Taylor-Harry
GitHub: Sepribo

Re: AutoHotKey script HELP please!!!

24 Mar 2018, 11:49

Just wait I'm looking for. Works perfectly! Thank you @Trogluddite for the quick response and for you help here! :)

Return to “Ask For Help”

Who is online

Users browsing this forum: artur1884, Bing [Bot], edison, Hash817, linearsoulchild, mikeyww, unknownerrors, WeedTrek, Xeo786 and 39 guests