Friday, July 20, 2012

AutoHotKey Script

Running the autocorrect script you may need to modify if using win+h for voice.
In the ahk search for #H and add ; to disable.

I need a place to keep some AutoHotKey script.
Great Hot Key List 

; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script has a special filename and path because it is automatically
; launched when you run the program directly.  Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it.  You can have as many .ahk
; files as you want, located in any folder.  You can also run more than
; one .ahk file simultaneously and each will get its own tray icon.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.

http://xahlee.info/mswin/autohotkey_key_notations.html syntax list
https://www.youtube.com/watch?v=MJxteBFvuEU best video
;`n (next line) ` is on the tilde key
; :: (runs command)
; ::xyz:: (auto correct)
; :o:xyz:: (auto correct no ending space added)
;no need for enter or space :*:hotkey::result
;'n will force next line
;adding the letter o in the first :o: will eliminate space after line
:r: treats everything in the string as raw text "!"for example
; Examples
;::bla:: blahblah@hotmail.com (this is auto correct)
; #z::Run www.autohotkey.com
;opens a web page
;Repurpose function keys
;F4::Run "C:\Program Files\Open\Program.exe"
;return
;Open folders
;#1:: Run, Explorer "C:\Downloads" ;Win + 1
;return

Script Starts Here
#Requires AutoHotkey v1.1
#SingleInstance,Force
; Windows=# Alt=! Shift=+ Conyrol=^

; v1
CoordMode, Mouse, Screen

^+m::
MouseGetPos, x, y
WinMove A,, %x%, %y%
return

; not needed use Win own ctl + w or alt + F4
 ^q::Send !{F4} (closes current window)

;pin window on top
^SPACE:: Winset, AlwaysOnTop, , A 
return

;Run Notepad
^!n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return

;Run Notepad++
!n::
IfWinExist Untitled - Notepad++.exe
WinActivate
else
Run Notepad++.exe
return

; Convert text to upper
^u::                                                               
 StringUpper Clipboard, Clipboard
 Send %Clipboard%
RETURN

; Convert text to capitalized
+^u::                                                             
 StringUpper Clipboard, Clipboard, T
 Send %Clipboard%
RETURN

; Google Search select text - Ctrl + Shift + C
 ^+c::
 {
  Send, ^c
  Sleep 50
  Run, http://www.google.com/search?q=%clipboard%
  Return
 }
return

^!d::
FormatTime, CurrentDateTime,, dd-MMM-yyyy
StringUpper, CurrentDateTime, CurrentDateTime
SendInput %CurrentDateTime%
return

;Run terminal as admin
^!t::Run *RunAs "C:\Users\George\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt.exe"

I have been using this script I grabbed from somewhere and it works fine.
I don't understand how it finds terminal to start it. I created the one above to make it shorter and figure out how to launch Window Store apps.

Opens Notepad and saves a text file to the Desktop
^!t::  ; Ctrl + Alt + T
; Set desktop directory
desktop := A_Desktop

; Generate a default file name with incremental count if needed
fileName := "New Text Document"
ext := ".txt"
count := 1
loop
{
    if (count = 1)
        fullPath := desktop "\" fileName ext
    else
        fullPath := desktop "\" fileName " " count ext

    if !FileExist(fullPath)
        break
    count++
}

; Create the file
FileAppend,, %fullPath%

; Open the file in Notepad
Run, notepad.exe "%fullPath%"
return

Ventoy On Secure Boot

I turn of secure boot in every BIOS. However, some do not show that setting. Here is an option that has worked for me. Boot the PC and launc...