GithubHelp home page GithubHelp logo

autohotkey-scripts-windows's Introduction

Top AutoHotkey scripts to get more out of Windows

Useful AutoHotkey scripts (Windows) for quick lookup, in-line calculator, remap keys, battery alert, and more.

Explanation

http://gourav.io/blog/autohotkey-scripts-windows

How to run script

  • Download and install main program (one-time step) https://www.autohotkey.com
  • Download a script (*.ahk) or copy paste script content in a text file and then rename it with .ahk extension e.g. my-script.ahk
  • Right-click -> Run script.
    You can also run scripts by double-click, or do right-click ->Open with -> AutoHotkey
  • Bonus: you can right-click and Compile script to make it a standalone *.exe program which would run without needing to install AutoHotkey first.

scripts inside /drafts folder are not tested properly and might not work. The rest of the scripts should work fine.

Run script at startup

Method 1:

  • Open startup folder: open Run window by Win+R and then write shell:startup and enter.
  • It'll open explorer at something like this path: C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • Copy script (*.ahk) -> go to that Startup folder -> right-click and select Paste shortcut.

OR

Method 2:

  • Put script_autorun_startup.vbs at startup folder. Make sure to put the correct path of your ahk scripts in that file first.

Run script as Admin

Put it at the beginning of the script:

; check if it is running as Admin, if not reload as Admin. put at top
if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"
   ExitApp
}

OR

Check Run this program as administrator in:

autohothey.exe > properties > compatibility > settings

Docs

Keys and their symbols

Common things often found at the beginning of AutoHotkey scripts

#NoTrayIcon              ;if you don't want a tray icon for this AutoHotkey program.
#NoEnv                   ;Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force    ;Skips the dialog box and replaces the old instance automatically
;;SendMode Input           ;I discovered this causes MouseMove to jump as if Speed was 0. (was Recommended for new scripts due to its superior speed and reliability.)
SetKeyDelay, 90          ;Any number you want (milliseconds)
CoordMode,Mouse,Screen   ;Initial state is Relative
CoordMode,Pixel,Screen   ;Initial state is Relative. Frustration awaits if you set Mouse to Screen and then use GetPixelColor because you forgot this line. There are separate ones for: Mouse, Pixel, ToolTip, Menu, Caret
MouseGetPos, xpos, ypos  ;Save initial position of mouse
WinGet, SavedWinId, ID, A     ;Save our current active window

;Set Up a Log File:
SetWorkingDir, %A_ScriptDir%  ;Set default directory to where this script file is located. (Note %% because it's expecting and unquoted string)
LogFile := "MyLog.txt"
FileAppend, This is a message`n, %LogFile%  ;Note the trailing (`n) to start a new line. This could instead be a leading (`n) if you want. (Note %% because it's expecting and unquoted string)

Community

autohotkey-scripts-windows's People

Contributors

gorvgoyl avatar ilovefreesw avatar iuriimattos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autohotkey-scripts-windows's Issues

Error when running script

Hi GorvGoyl,

I love the idea of your script, but does it still work? I'm getting the following errors when running the script.

image

I run Windows 10 and am using other AHK-scripts without problems.

Thanks.

Nice Script

Just wanted to say I really like the sccript "look_up.ahk". I did modify it for my personal use but gave all credit to you.
Thanks for the script.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%\Assets ; Ensures a consistent starting directory.
#SingleInstance Force
SetTitleMatchMode 2

/*

@author : GorvGoyl
@script Name : Duck_Search.ahk / Look_Up.ahk
@script Version : 0.1.0
@homepage : https://github.com/GorvGoyl/Autohotkey-Scripts-Windows/blob/master/look_up.ahk

@creation Date : May 09, 2022
@modification Date : 07:01 AM "CST" 2022/08/14

@description :

I modified this script but all credit goes to GorvGoyl. It now
use's DuckDuckGo as the search engine and Firefox browser.  

=================================================================
*/

; Run Script as Admin (Reload if not as Admin)
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}

Menu, Tray, Icon, duckduckgo.ico

^d:: ; use ctrl + d <-- DuckDuckGo Search Using Highlighted Text in Browser and Do DuckDuckGo Search / Visit Site (if it's url)
MyClip := ClipboardAll
Clipboard = ; empty the clipboard
Send, ^c
ClipWait, 2
if ErrorLevel ; ClipWait timed out.
{
return
}
if RegExMatch(Clipboard, "^[^ ].[^ ]$")
{
Run "C:\Program Files\mozilla firefox\firefox.exe" %Clipboard%
}
else
{
; Modify some characters that screw up the URL
; RFC 3986 section 2.2 Reserved Characters (January 2005): !*'();:@&=+$,/?#[]
StringReplace, Clipboard, Clipboard, rn, %A_Space%, All
StringReplace, Clipboard, Clipboard, #, %23, All StringReplace, Clipboard, Clipboard, &, %26, All
StringReplace, Clipboard, Clipboard, +, %2b, All StringReplace, Clipboard, Clipboard, ", %22, All
Run % "https://www.duckduckgo.com/?q=" . clipboard ; uriEncode(clipboard)"
}
Clipboard := MyClip
return

; Handy function.
; Copies the selected text to a variable while preserving the clipboard.
GetText(ByRef MyText = "")
{
SavedClip := ClipboardAll
Clipboard =
Send ^c
ClipWait 0.5
If ERRORLEVEL
{
Clipboard := SavedClip
MyText =
Return
}
MyText := Clipboard
Clipboard := SavedClip
Return MyText
}

; Pastes text from a variable while preserving the clipboard.
PutText(MyText)
{
SavedClip := ClipboardAll
Clipboard = ; For better compatability
Sleep 20 ; with Clipboard History
Clipboard := MyText
Send ^v
Sleep 100
Clipboard := SavedClip
Return
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.