Practice is the best learning. This concentration camp is divided into phases x + MC2 (X indicates the number of issues, M indicates my free time, and C indicates my motivation to update ), the aim is to improve Ahk language proficiency by reading script code. The difficulty of the script is proportional to the number of times. If you are interested, you can catch up with the script in the form of a drama :)
Modify the key symbol and "run"
A hot key is a common shortcut key. pressing a hot key can trigger a specific action. For example, I usually use win + D to minimize all windows. The modifier is used in the Ahk language to replace the hotkey name. For example, # represents the win logo key. After all, you do not want to enter too many words.
Next let's take a look at common hotkeys and their modifier key symbols:
It takes three minutes to remember them. Remember this and we will be able to access the most basic command "run! Sure, the pupils also know the meaning of run. That's right. It's just running. But in Ahk, run should be more expressive. It is used to start a program, open a document, or even open a link.
1 Run Notepad2 Run C:\My Documents\Address List.doc3 Run C:\My Documents\My Shortcut.lnk4 Run www.cnblogs.com5 Run mailto:[email protected]
- Line 1: Open notepad. The notepad is set in the system, that is, run the command.
- Row 2: Open the DOC file in the specified directory. Because some files are not in combination with the system, the complete file path is required here.
- Row 3: Open the shortcut.
- Row 4: Use the default browser to open the website.
- Row 5: send emails to a specified email address. Do not expect blank emails to be sent at will. This requires an email client on your computer, such as Foxmail.
Of course, you may ask now, what is the relationship between this and the hotkey? Don't worry. Now we can talk about it. We only need to connect the hotkey and command to form a complete command. Only run tells you to eat, and the hotkey tells you when to eat, you can eat. Then how can we connect the hotkey with the command? Let's look at a simple example.
!N::Run Notepad
In this way, use ":" to connect the two. press Alt + n to open notepad.
What if I want to open the notepad and command line windows at the same time when I press Alt + n? Here.
1 !N::2 Run Notepad3 Run cmd4 return
Adding a return value to the last line indicates that it is OK after the end ~
The concentration camp has ended. The next issue is tentatively scheduled for one year. Pai_^