Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoHotKey for a very simple task 1

Status
Not open for further replies.

Deniall

Technical User
May 15, 2011
250
4
18
Australia
rmniall.com
I am a first-time user AutoHotKey (AHK), trying to get it to give me a shortcut for a text string (my email address) that I have to enter very frequently in all sorts of contexts.[ ] The shortcut I wanted to use was Ctrl-Shift-R, and I expected this would be an easy task requiring only the single line of AHK "code" that follows:
[ ][ ][ ][ ][tt]^+R::DonaldDuck_at_Disney.fun[/tt]
However this (and several close variants) never even got to first base, and gave various unhelpful error messages when I tried to "load" them (using AHK version 2.0.10.0 as downloaded last night).

The documentation for AHK overwhelmed and bamboozled me, concentrating on all the wonderfully complex things it can do, and avoiding the ultra-simple.[ ] Hours of googling didn't help very much.[ ] I eventually got the following script to load without errors.[ ] The first of the two approaches does actually work, while the second one does absolutely nothing.
Code:
#Requires AutoHotkey v2
#SingleInstance Force
::RR::Hello World via "double-R"     ;;; RR or rr or rR work, but are not ideal for me.
::^+R::Hello World via Ctrl-Shift-R  ;;; Does absolutely nothing.

I can live with this if necessary, but I would much prefer to be able to invoke my text string with the single "function key" of Ctrl-Shift-R (^+R in AHK-ese) which does not work using the method above.

Is anyone in this forum sufficiently conversant with AHK to point me in the right direction?



[sub][ ]—————————————————————————————————[/sub]
[sup]Engineering mathematician/analyst.[ ] See my profile for more details.[/sup]
 
No doubt some of the knowledgeable people in this forum will be able to help you. But just in case they can't, you might try posting your question at AutoHotkeys' own help forum, at It contains a section where you can "Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys", which seems to be quite active.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks, Mike.[ ] I registered at the AHK site you gave, and submitted my query.[ ] However it has not been posted yet b/c they (quite rightly) want to individually vet the first posts from new members before actually posting them.[ ] In the meantime I did some more spade-work (an embarrassingly large amount) and found my answer.[ ] I needed to use AHK's Send function and to enclose my string in quotation marks.[ ] Thus:
Code:
#Requires AutoHotkey v2
#SingleInstance Force
^+r::Send "DonaldDuck_at_Disney.fun"


[sub][ ]—————————————————————————————————[/sub]
[sup]Engineering mathematician/analyst.[ ] See my profile for more details.[/sup]
 
I was late spotting this but here's the AHK oneliner I use:

Code:
:*:@@::DonaldDuck_at_Disney.fun

The :*:mad:@:: bit just means... whenever I type two consecutive @ characters then AutoHotkey overwrites them with my full email address.

Hope this helps someone...
 
Thanks.[ ] It has (further) helped me, and has become my preferred approach.

[sub][ ]—————————————————————————————————[/sub]
[sup]Engineering mathematician/analyst.[ ] See my profile for more details.[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top