As you guys know I am a huge fan of system-wide shortcuts. I particularly use AutoHotKey (AHK) to speed up my workflow. If you have not yet configured the AHK, head down to my blog and do that now. -(link-> mastering-advanced-shortcuts-with-ahk-autohotkey-altium-examples).
Google Search Of Highlighted Text From Any Application ( WIN+Z )
This is a no-brainer to implement and a must-have as an engineer what we most is to search keywords in google. Having a system-wide shortcut will help you save precious time and keep you more productive . The initial code was configured to work with WIN+G, then me being the lazy guy you know was too lazy to extend my fingers to the middle of the keyboard and relocated it to
WIN+Z for text search
WIN+SHIFT+Z for Image search
WIN+ALT+Z for Map search
; Google Search
; Google Search of Highlighted Text
;
;{-----------------------------------------------
; If Internet Explorer is already running it will add search as new tab
;}
; INITIALIZATION - ENVIROMENT
;{-----------------------------------------------
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ; Ensures that only the last executed instance of script is running
;}
; AUTO-EXECUTE
;{-----------------------------------------------
;
RegRead, ProgID, HKEY_CURRENT_USER, Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice, Progid
Browser := "iexplore.exe"
if (ProgID = "ChromeHTML")
Browser := "chrome.exe"
if (ProgID = "FirefoxURL")
Browser := "firefox.exe"
;T
;}-----------------------------------------------
; END OF AUTO-EXECUTE
; HOTKEYS
;{-----------------------------------------------
;
#z:: ; <-- Google Web Search Using Highlighted Text
Search := 1
Gosub Google
return
^#z:: ; <-- Google Image Search Using Highlighted Text
Search := 2
Gosub Google
return
!#z:: ; <-- Google Map Search Using Highlighted Text
Search := 3
Gosub Google
return
;}
; SUBROUTINES
;{-----------------------------------------------
;
Google:
Save_Clipboard := ClipboardAll
Clipboard := ""
Send ^c
ClipWait, .5
if !ErrorLevel
Query := Clipboard
else
InputBox, Query, Google Search, , , 200, 100, , , , , %Query%
StringReplace, Query, Query, `r`n, %A_Space%, All
StringReplace, Query, Query, %A_Space%, `%20, All
StringReplace, Query, Query, #, `%23, All
Query := Trim(Query)
if (Search = 1)
Address := "http://www.google.com/search?hl=en&q=" Query ; Web Search
else if (Search = 2)
Address := "http://www.google.com/search?site=imghp&tbm=isch&q=" Query ; Image Search
else
Address := "http://www.google.com/maps/search/" Query ; Map Search
if (Browser = "iexplore.exe")
{
Found_IE := false
For wb in ComObjCreate("Shell.Application").Windows
If InStr(wb.FullName, "iexplore.exe")
{
Found_IE := true
break
}
if Found_IE
wb.Navigate(Address, 2048)
else
{
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate(Address)
}
}
else
Run, %browser% %Address%
Clipboard := Save_Clipboard
Save_Clipboard := ""
return
;}
Auto Replace Symbols In Text
Have the right symbols in your document to represent ohms ‘Ω’ or degree celsius ‘°C’. dose make your documentation look super pro. but having to type them on a keyboard with alt keys or going to the font mapper is too much work and can get painstakingly difficult when you are given a laptop with no num-pad. As even if you are familiar with the alt keys you can’t enter the code to get the symbols. This is my idea for implementing alt keys as text replacement with AHK.
Type the following seq to get them auto replaced with respective symbols.
]o replace with symbol -> Ω
]ko replace with symbol -> kΩ
]d replace with symbol -> °
]dc replace with symbol -> °C
]u replace with symbol -> µ
]uF replace with symbol -> µF
]a replace with symbol -> α
]b replace with symbol -> ß
]n replace with symbol -> ╖
]t replace with symbol -> τ
]p replace with symbol -> π
]w replace with symbol -> Θ
; AUTO REPLACE
;{-----------------------------------------------
;
::]o::{Alt Down}{Numpad2}{Numpad3}{Numpad4}{Alt Up}; symbol -> Ω
::]ko::k{Alt Down}{Numpad2}{Numpad3}{Numpad4}{Alt Up}; symbol -> kΩ
::]d::{Alt Down}{Numpad0}{Numpad1}{Numpad7}{Numpad6}{Alt Up}; symbol -> °
::]dc::{Alt Down}{Numpad0}{Numpad1}{Numpad7}{Numpad6}{Alt Up}C; symbol -> °C
::]u::{Alt Down}{Numpad2}{Numpad3}{Numpad0}{Alt Up}; symbol -> µ
::]uF::{Alt Down}{Numpad2}{Numpad3}{Numpad0}{Alt Up}F; symbol -> µF
::]a::{Alt Down}{Numpad2}{Numpad2}{Numpad4}{Alt Up}; symbol -> α
::]b::{Alt Down}{Numpad2}{Numpad2}{Numpad5}{Alt Up}; symbol -> ß
::]n::{Alt Down}{Numpad9}{Numpad5}{Numpad1}{Alt Up}; symbol -> ╖
::]t::{Alt Down}{Numpad2}{Numpad3}{Numpad1}{Alt Up}; symbol -> τ
::]p::{Alt Down}{Numpad2}{Numpad2}{Numpad7}{Alt Up}; symbol -> π
::]w::{Alt Down}{Numpad2}{Numpad3}{Numpad3}{Alt Up}; symbol -> Θ
These are some of the keys that I use, but you get the idea I suppose. If you need more special characters in your routine have a look at the alt keys here (link-> FreeCodeCamp alt keys ).
Auto Expand Signature
whenever sending messages over electronic media we always attach our signature stating. Simplify the process by adding text replacements some examples of what I use daily. Do replace in the areas you are seeing the name and phone number and whatever that you keep in the signature.
Also, that Please find attached mail that you always send can be made to match with the template. These are some ideas for expansion texts. I belive the world will be your limit.
just type
]sig for a simple signature
]tsig for a thankyou signature
]pfamail for please find attached mail template
; AUTO EXPANSION SIGNATURE AND MAIL TEMPLATE
;{-----------------------------------------------
;
::]sig::<Your Name>{enter}+(<Country code>) <phone#>{enter}<www.blog.mxdesign.uk>
::]tsig::Thank you{enter}<Your Name>{enter}+(<Country code>) <phone#>
::]pfamail:: Hello,{enter} Please find attached {enter}{enter}Thank you{enter}<Your Name>{enter}+(<Country code>) <phone#>{enter}<www.blog.mxdesign.uk>
Auto Insert Date And Time
If you are like me, then you will require to save files or insert dates frequently for managing the file structure sane.
WIN + <Right arrow> for Inserting date and time anywhere
; AUTO INSERT date and time
;{-----------------------------------------------
; Add date and time with WIN + right_arrow
#right::
FormatTime, time, A_now,d-MMM-yy_hh-mmtt
send %time%
return
Suspend AHK (AutoHotKey)
Have to admit one thing, Having AHK run all the time, It gets in the way by screwing up some function in the natrive app. for that frustrating time press WIN+CAPSLOCK and you are free from all the scripts that you have put over all the apps. you are home free till you find that you cant like with out the shortcuts and enable back by executing the combo
WIN + CAPS LOCK suspend / enable AHK 🙂
Hope these will provide you with some mad skills to beat those repetitive tasks. Let me know if you would add anything to my essentials.
Making the world lazy, one at a time. – 🙂

Be First to Comment