gorvgoyl / autohotkey-scripts-windows Goto Github PK
View Code? Open in Web Editor NEWAutohotkey scripts to make you more productive when using Windows.
Autohotkey scripts to make you more productive when using Windows.
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
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, r
n, %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
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.