Releases: Fajar-RahmadJaya/AutoHotkeyCollection
Screen Coordinate Auto Detect And Copy
Description :
This script is to help you getting coordinate to use on screen clicker. To use it, You just need to click 'space' at default. This script is useful if you work with screen such as programmer or designer. It also easy to use where you just need to press on key and it will automatically take the coordinate and copy it. Because it automatically copy the coordinate, you just need to paste the coordinate if you need it. The coordinate also show up on cursor using tooltip to help user getting coordinate more flexible. Don't worry, because the tooltip is small and generally would not disturb you as it also disappear fast.
How To Use Template :
What you can change is only 1, that is the condition to start coordinate finder. At default, it's space but you can change it to whatever you need. This not only limited to one key, but you can also use key combination such as shortcut.
Example Changing Template :
I will give you example the script change. Example, do Screen Coordinate Auto Detect And Copy when pressing (Left Alt + Win)
The script should be :
Persistent
SetTitleMatchMode(2)
Lalt & Lwin:: ; Condition to Activate or Deactivate Change
{
MouseGetPos(&mouseX, &mouseY)
coordFormat := "[" mouseX "," mouseY "]"
A_Clipboard := coordFormat
ToolTip("The coordinate has been copied:`n" coordFormat)
SetTimer(RemoveToolTip,-2000)
return
}
RemoveToolTip()
{
global
ToolTip()
return
}
Full Code :
Persistent
SetTitleMatchMode(2)
Space:: ; Change this for script to take coordinate
{
MouseGetPos(&mouseX, &mouseY)
coordFormat := "[" mouseX "," mouseY "]"
A_Clipboard := coordFormat
ToolTip("The coordinate has been copied:`n" coordFormat)
SetTimer(RemoveToolTip,-2000)
return
}
RemoveToolTip()
{
global
ToolTip()
return
}
Screen Clicker
Description :
Another useful you can use with AutoHotkey is screen clicker. What screen clicker do is clicking some coordinate on your screen with some interval. There is not much program or software that can do this. If there any, it usually need you to pay to be able to use it. Fortunately there is AutoHotkey that can help you. Screen clicker can be useful if you have repetitive task such as filling form, simulate click, or even clicking element. You can also activate or deactivate it using some key combination to make it more convenient and flexible. Don't worry, because i also made an AutoHotkey script to take screen coordinate and copy it automatically.
How To Use Template :
There are 3 thing you can modify in this script :
- Screen clicker toogle ( To activate or deactivate screen clicker ):
q & e::(Line 3) - Screen coordinate :
coordinates := [[500, 300], [600, 400], [700, 500]](Note : You can the coordinate as much as you want) (Line 19) - Interval :
interval := 500(Line 29)
Example Changing Template :
I will give you example the script change. Example, do screen clicker with coordinate [100, 0], [0, 100], [100, 100], [200, 100], [200, 200], [0, 200] with interval 1 minute (60.000 millisecond) if i press (Left Alt + Space).
- Open chrome and download folder with shortcut assignment 'alt+space'
toggle := false
Lalt & Space:: ; 'Screen Will Activate or Deactivate if Keys Pressed' Change
{
global
toggle := !toggle
if (toggle) {
SetTimer(ClickLoop,100)
} else {
SetTimer(ClickLoop,0)
}
return
}
ClickLoop()
{
global
coordinates := [[100, 0], [0, 100], [100, 100], [200, 100], [200, 200], [0, 200]] ; Coordinate Change
Loop coordinates.Length != 0 ? coordinates.Length : ""
{
x := coordinates[A_Index][1]
y := coordinates[A_Index][2]
MouseMove(x, y)
Click()
interval := 60000 ; Interval Change
Sleep(interval)
}
return
}
Full Code :
toggle := false
q & e:: ; Change this to toggle screen clicker on or off
{
global
toggle := !toggle
if (toggle) {
SetTimer(ClickLoop,100)
} else {
SetTimer(ClickLoop,0)
}
return
}
ClickLoop()
{
global
coordinates := [[500, 300], [600, 400], [700, 500]] ; Change the interval to your preference
Loop coordinates.Length != 0 ? coordinates.Length : ""
{
x := coordinates[A_Index][1]
y := coordinates[A_Index][2]
MouseMove(x, y)
Click()
interval := 500 ; Change the interval to your preference in millisecond
Sleep(interval)
}
return
}
Auto Clicker
Description :
AutoHotkey can also be used as auto clicker. But not like other auto clicker, AutoHotkey can made you able to add more command to the clicker. For example in this code, you can use 'e' to make condition for it to work. So, if you hold 'e' it will send left click multiple time and you can adjust the interval between click. For short, with this you can do more advance auto clicker in lightweight size. You can also use this as template or adjust to your preference on interval, condition for script to work, change left click with another keys etc.
How To Use Template :
You can change the code to your preferences like what i describe with adjusting some code such as :
- Change interval :
ClickInterval := 100 - Change what key to click :
$e::and$e up:: - Change auto click key :
Click
Example Changing Template :
I will give you example if i want to change the code for it to behave like this :
- Auto clicking 'Space' when i press 'Left Alt' with interval 1 minute (60000 millisecond) :
ClickInterval := 60000 ; Change the interval to 1 minute (60000 millisecond)
global isClicking := false
$Lalt:: ; Change the 'to doing auto click when left alt is held' 1
{
global isClicking
isClicking := true
while (isClicking)
{
Space ; Change Auto Clicking to Space
Sleep(ClickInterval)
}
}
$Lalt up:: ; hange the 'to doing auto click when left alt is held' 2
{
global isClicking
isClicking := false
}
Full Code :
ClickInterval := 100 ; Change this if you want to change the interval
global isClicking := false
$e:: ; Change this if you want to change hold 'e' for condition to do auto clicker
{
global isClicking
isClicking := true
while (isClicking)
{
Click ; Change this if you want to change left click to another key for auto clicker
Sleep(ClickInterval)
}
}
$e up:: ; Change this if you want to change hold 'e' for condition to do auto clicker
{
global isClicking
isClicking := false
}
Multiple Files Opener
Description :
You can open some files using shortcut. For example, i want to open files 1 and files 2 when clicking 'alt+left arrow'. I can do that with adjusting some of this code then run the script. After i click 'alt+left arrrow' it should opening files 1 and files 2. Files i mean here is not just files, you can use whatever in your device as long as it has their path like "D\MyFolder\MyFiles". You can use it if you don't want to go to your files directory or want to make your desktop clean. If you want the script to auto run on startup, click this for more info so you can add or remove your script from startup easily. Of course you can also not assign any shortcut to it so if the script clicked or run it will directly open the files or you can just made it to run on startup so your files will automatically opened when you log to your device. Adjust it to your preference and creativity.
How To Use Template :
You can change the code to your preferences like what i describe with adjusting some code such as :
- Assign Shortcut :
alt & left:: - Open the files :
Run("C:\Your\files\path\with\double\quotation\mark")(Be sure to change this)
Example Changing Template :
I will give you example if i want to change the code for it to behave like this :
- Open chrome and download folder with shortcut assignment 'alt+space'
Alt & Space::
{
Run("C:\Users\<username>\Desktop\Downloads - Shortcut.lnk")
Run("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk")
}
return
Full Code :
Alt & Left::
{
Run("C:\\path\\to\\your\\file1.txt") ; Made sure to change this with your file path
Run("C:\\path\\to\\your\\file2.txt") ; You can also copy and paste this line for more file like this
Run("C:\\path\\to\\your\\file3.txt")
}
return
Using Shift To Do Copy, Paste, Select All, Undo
If you can't use ctrl and you don't have key to replace it, you can change shift to ctrl but still can use shift. For example if you click 'shift+c' it will send 'ctrl+c', but if you click 'shift+q' or just 'shift' it will still send 'shift+q' or just 'shift'. You can also combined it with different script like change alt to shift, so whenever you click 'alt+c' it will send 'ctrl+c'. This script is useful if you don't use shift+ctrl command and want to change ctrl command to shift. You can also use it as template for another key if you want to do the same.
Here is the full code of it :
; Shift+C for Copy
+c::Send ^c ; Sends Ctrl+C when Shift+C is pressed
; Shift+V for Paste
+v::Send ^v ; Sends Ctrl+V when Shift+V is pressed
; Shift+A for Select All
+a::Send ^a ; Sends Ctrl+A when Shift+A is pressed
; Shift+Z for Undo
+z::Send ^z ; Sends Ctrl+Z when Shift+Z is pressed
Typing Numbers With Caps Lock For AZERTY Keyboard
Description :
If you use AZERT layout for your keyboard and you want to easily type number with capslock then this is what you are looking for. This script work using capslock as condition, so you need to enable capslock first for it to work. You can also use this as template for another script because capslock doesn't affect number row so why not use it to increase type experience. This script not only work for AZERTY but also another layout, but you need to adjust the code first.
How To Use As Template :
If you want to use it as template here is some command you need to change :
- What you need to change :
&:: ; Map '&' key (1)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 1 ; Send '1'
}
else
{
Send, & ; Send '&'
}
return
- If you want to change key to remap, you can adjust this script and the like
&:: ; Map '&' key (1)and
else
{
Send, & ; Send '&'
}
- Then to change what it send, you can adjust this script and the like
Send, 1 ; Send '1'. - Example if you want to change '1' to send '!' if capslock on then it will be like this :
1:: ; the change
if GetKeyState("CapsLock", "T")
{
Send, {!} ; the change
}
else
{
Send, 1 ; the change
}
return
- The example above will send '!' if you click '1' when capslock is on.
Full Code :
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; Remap keys based on Caps Lock state
&:: ; Map '&' key (1)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 1 ; Send '1'
}
else
{
Send, & ; Send '&'
}
return
SC003:: ; Map 'é' key (2)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 2 ; Send '2'
}
else
{
Send, é ; Send 'é'
}
return
":: ; Map '"' key (3)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 3 ; Send '3'
}
else
{
Send, `"` ; Send '"' (escaped with backtick)
}
return
':: ; Map "'" key (4)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 4 ; Send '4'
}
else
{
Send, ' ; Send "'" (single quote)
}
return
(:: ; Map '(' key (5)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 5 ; Send '5'
}
else
{
Send, ( ; Send '('
}
return
-:: ; Map '-' key (6)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 6 ; Send '6'
}
else
{
Send, - ; Send '-'
}
return
SC008:: ; Map 'è' key (7)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 7 ; Send '7'
}
else
{
Send, è ; Send 'è'
}
return
_:: ; Map '_' key (8)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 8 ; Send '8'
}
else
{
Send, _ ; Send '_'
}
return
SC00A:: ; Map 'ç' key (9)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 9 ; Send '9'
}
else
{
Send, ç ; Send 'ç'
}
return
SC00B:: ; Map 'à' key (0)
if GetKeyState("CapsLock", "T") ; If Caps Lock is ON
{
Send, 0 ; Send '0'
}
else
{
Send, à ; Send 'à'
}
return