AutoHotKey

Hotkey for next song in Spotify

删除回忆录丶 提交于 2019-11-29 21:27:27
After March 2015 upgrade of Spotify the below hotkey no longer works to get next song in Spotify: ; Spotify next track <^>!p:: DetectHiddenWindows, On ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow DetectHiddenWindows, Off Return The SpotifyMainWindow" appears to be the same when checking with spy, and Ctrl-Right also still works for next song in Spotify, but the hotkey don't. How to make a hotkey for next song in the upgraded Spotify? I managed to make it work using multimedia keycodes. Here's my script: ; "CTRL + LEFT" for previous ^Left::Media_Prev ; "CTRL + RIGHT" for next

How to globally map AltGr key to Alt key?

我只是一个虾纸丫 提交于 2019-11-29 20:17:07
I want my AltGr key to behave exactly like left Alt . Usually, I do this kind of stuff with Autohotkey , but I'm open to different solutions. I tried this: LControl & RAlt::Alt And Autohotkey displayed error about Alt not being recognized action. Then I tried the following code: LControl & RAlt:: Send {Alt down} KeyWait LCtrl KeyWait Ralt Send {Alt up} return which sort of works - I'm able to use the AltGr key for accessing hotkeys, but it still behaves differently: When I press and release the left Alt , the first menu item in the current program receives focus. Pressing and releasing AltGr

Choosing a Windows automation scripting language. AutoIt vs Autohotkey [closed]

感情迁移 提交于 2019-11-29 18:43:31
I need to choose a Windows automation scripting language. Which one do you recommend; AutoIt , AutoHotkey , or an other? I have read " An AutoIt / AutoHotkey comparison ". Interesting history, but without recommendation. Searching Google leaves around 312k hits for AutoHotkey Windows vs 482k for AutoIt Windows . On Stack Overflow there are 15 questions tagged autoit vs 18 autohotkey . I am interested in your opinion as programmers. Which one do you think is easier to use, more deployable and more powerful in terms of functionality? I have already used AutoHotkey for personal use, so my initial

AHK: Assign hotkey only for one specific active window and not for others

核能气质少年 提交于 2019-11-29 18:17:28
I have just done a piece of code that does the following thing. When I make a selection by mouse in Firefox or EndNote, the script sents a Ctrl+c and checks the clipboard for a regex match. If there is a match, it changes the clipboard contents and shows a tooltip. It works fine for these two programs. Adobe Acrobat sometimes shows an error when a Ctrl+c is sent (even if a user presses a ctrl-c Acrobat sometimes shows famous "There was an error while copying to the Clipboard. An internal error occurred). So it decided to assign an F9 hotkey, but it works for all programs and not just for

Macro Keys not Detected AutoHotkey

一世执手 提交于 2019-11-29 16:46:33
I have just purchased the Steelseries apex gaming keyboard and rival mouse. Unfortunately, each of these products has different software for macros and keyboard lighting, both of which are mediocre at most. Instead of having 2 processes running in the background and having to use 2 crappy programs to write my macros, I have decided to use AutoHotkey for my macros, some of which I plan on making quite complex. The mouse was no problem in AutoHotkeys, with the two side buttons using XButton1 and XButton2, however no matter what I do, I can't detect my keyboard macro keys (M1 to M12 and MX1 to

Remove single line breaks, keep “empty” lines

佐手、 提交于 2019-11-29 10:13:01
Say I have text like the following text selected with the cursor: This is a test. This is a test. This is a test. This is a test. I would like to transform it into: This is a test. This is a test This is a test. This is a test In other words, I would like to replace single line breaks by spaces, leaving empty lines alone. I thought something like the following would work: RemoveSingleLineBreaks() { ClipSaved := ClipboardAll Clipboard = send ^c Clipboard := RegExReplace(Clipboard, "([^(\R)])(\R)([^(\R)])", "$1$3") send ^v Clipboard := ClipSaved ClipSaved = } But it doesn't. If I apply it to the

How to do logins using the WinHttpRequest COM?

老子叫甜甜 提交于 2019-11-29 07:59:32
You can see lots of people automating things on websites using mouseclick and keystroke simulation on browser windows or using the IE COM, but for some applications you don't want your application to take hundrets of megabytes of RAM and use loads of CPU power to render the website etc. So the question is: How to do logins to websites / webservices using AutoHotkey without a browser but using the WinHttpRequest COM? I already posted this on the AHK forums, but I think the information is useful enough to get archived on Stackoverflow as well. :) Tools & getting started First of all, if you want

How to add administrator privileges to AutoHotkey script?

北战南征 提交于 2019-11-29 07:46:19
I compiled it to an executable, but to open it I have to right-click and press "Run as administrator". I want it to request admin privileges each time I run it, but how to do it? I can't do this: Because then it doesn't work when I copy it to a second computer. Try adding this to the auto-execute section (top of the script): ; If the script is not elevated, relaunch as administrator and kill current instance: full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")) { try ; leads to having the script re-launching itself as

How can I get the current browser URL with an AutoHotKey script?

回眸只為那壹抹淺笑 提交于 2019-11-29 06:56:14
I'm looking for a way in AutoHotkey to put the currently visited url in a variable. The goal of this AHK is to trace what I've been doing during the day to log my hours better. I have another system which I use to clock my work, but sometimes I forget to use it when I get side-tracked. loop { ; Get current Window ID & Name WinGet, active_id, ID, A WinGet, process_name, ProcessName, A ; Only do anything if any other windows was activated if(active_id = PrevActiveId) { ; Do nothing } else { ; Format the time-stamp. current=%A_DD%/%A_MM%/%A_YYYY%, %A_Hour%:%A_Min% ; Write this data to the log.txt

What happens 'behind' the windows lock screen?

拥有回忆 提交于 2019-11-29 01:14:56
I have been working on windows automation and monitoring. What exactly happens when I lock the screen of a windows machine? I am working with Windows 7 at the moment, are there big differences to the behavior if I switch to Vista or the server versions? Is there still a desktop that can be accessed via api's? I know that i can still send key strokes and mouse clicks to specific windows (via ControlSend and ControlClick ), but there seems to be no "desktop" itself. Could someone shed some light on this whole thing or point me at a readable source where I could get an overview over the topic?