Autohotkey 0-level introductory Tutorial: one-click repeat

Source: Internet
Author: User
Autohotkey is a magic tool. To help new users get started, xbeta wrote this dummies 0-level introductory tutorial, and was reproduced by pconline with the title of deduction Duan's "lingbo micro-step" autohotkey 0-level introductory tutorial.

 

1 What is autohotkey?
Autohotkey is a small tool that simplifies repetitive work.
For example, to log on to a forum, you only need to press a key and autohotkey will open ie for you (Firefox, opera, or Maxthon is recommended), enter the URL, enter the user name and password, and press Enter.
As long as you have the imagination, it can do more work. For more information, see autohotkey, to make win + run more powerful, and tag: autohotkey.
2. Download and install
Download: The file is small, only 1.6 Mb. See the download page on the official website. The zip installation-free version is also available.
Install: Follow the prompts. I used to install it on D:/program files/autohotkey.
1st screen is welcome; click Next.
The 2nd screen is the copyright notice; click I agree.
The 3rd screen is the installation content, for example. We recommend that you select the first two items, but not the first 3rd items.

4th screen is the installation directory: My habit is D:/program files/autohotkey. We can see that only 2 MB space is required. Powerful software does not require a huge volume. Being able to make the software smaller is a reflection of the author's skill and a reflection of respect for users.
If the installation is successful on the 5th screen, the following message is displayed: Check readme. This readme is actually its help file, which is very detailed. If you are patient, read it carefully. If you want to be a master, you must study it. (For some Chinese translations, see http://yonken.yourfreewebspace.com /)
  
3 Application Example 1
For example, open your text editor (Notepad, or gvim), create a new file, and copy the content of the next two lines. Save it to a place, such as D:/program files/autohotkey/My/New. Ahk.
Msgbox, this is my first autohotkey script 'n' I support free software and respect copyright
Run, http://blog.sina.com.cn/m/xbeta
Then, you can double-click New. Ahk to see the effect:
The following prompt is displayed.
  
After you confirm, you can open your browser and choose to make good use of the beautiful soft blog.
Explain:
The so-called script is actually a TXT file.
Msgbox is a command (or function). When autohotkey sees it, it will know that a message window will pop up. "This is my ...... "Copyright" is a parameter. Here it is the text of the pop-up message. 'N' indicates line feed. Separated by commas.
2nd: Similarly, the function is run, or run. The following parameters are the URL of this blog. That is to say, autohotkey can run a program, also can run document name (such as D:/freeware-list.txt), also can run web site. 4 Application Example 2
Copy the following content to new. Ahk.

#0 ::
MsgboxThis is my first autohotkey script 'n' I support free software and respect copyright
RunHttp://blog.sina.com.cn/m/xbeta
Return

#1 ::
RunHttp://mail.163.com
Winactivate, Maxthon; prevent window from being inactive
Winwait, Netease; wait until the webpage is loaded successfully (at least the title is displayed)
Sleep, 500; for the sake of insurance, wait another 0.5 seconds (depending on the network speed)
Send, Myid {tab} password {enter}; simulate the user name, password, and press ENTER
Return

Run again ...... No response?
Because we have defined two hotkeys: Win + 0, win + 1, respectively, and two scripts, that is, access to hausoft and log on to the 163 mailbox.
You can also see several new function names. For details, see the help of autohotkey.
There must be at least one space between the comment and the formal statement, which is guided by a half-width Semicolon. This will help you understand the Ahk file in the future and will not execute it.

5 postscript
Level 0 tutorials are written here.
Further improvement requires more hands-on operations. Read more functions in help.
I strongly recommend yonken's article "getting started with automated operations". He strives to disseminate autohotkey and autoit and carefully translated a large number of original documents.
I will also write some application instances one after another, such as autohotkey | win run. It is more convenient to add them. autoit3 vs autohotkey and autohotkey call irfanview to optimize the 24-bit true color image to the actual color depth ...... Please pay attention to the best use of relevant topics.

Supplement: xbeta uses gvim to edit the Ahk file. The highlighted effect is as follows:

※Draft 060913, source http://blog.sina.com.cn/u/46dac66f010005g7
※The author xbeta adopts the CC creation and sharing agreement, which can be <signed, non-commercial, and consistent> reproduced. This information must be kept

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.