AutoHotKey

Is it possible to catch the close button and minimize the window instead? AutoHotKey

余生颓废 提交于 2019-12-17 17:14:14
问题 I want all programs in my computer to be closed only by right clicking the taskbar icon and choosing close. So when I click the X button on any window, it should translate to minimize instead. How can I achieve this using AutoHotKey? 回答1: This AutoHotkey script should achieve what you're looking for. Note: the code may not work correctly if aero mode is on. MouseGetPos gets the hWnd of the window under the cursor. WM_NCHITTEST gets information about the type of item under the cursor, needing

How can I focus and autofill a text field in Autohotkey?

心不动则不痛 提交于 2019-12-14 03:58:11
问题 I'm attempting to write a script to automatically fill a web-field with the current date using an AutoHotkey script. However, I'm not sure how to focus a specific field by its name or id . My current hacky workaround is to use Send, {Tab 84} to scroll to the specific field, type the date with Send, 6/28/2017 , and submit the field manually. While the script works most of the time, it's blatantly apparent there are better methods. How can I focus autofill specific text-field on a webpage using

Windows going crazy after typing Romanian characters using a Romanian Programmers layout while remapping Alt/Ctrl/Win with Autohotkey

一世执手 提交于 2019-12-14 03:55:56
问题 I've remapped some keys using Autohotkey, like this: LWin::LAlt LCtrl::LWin LAlt::LCtrl I'm using Windows 7 with the Romanian (Programmers) keyboard layout. If I want to type ă I hit RAlt + a, for example. It's called "Programmers" because it's a reqular US QWERTY layout with extras activated by RAlt. However, if I run my Autohotkey script AND then I send a RAlt + a/s/t/i, the system goes bonkers. Even if I close Autohotkey it still behaves like that. I have to log off/reboot or hit magic key

How to set AutoHotKey process priority & radom sleep?

大兔子大兔子 提交于 2019-12-14 03:03:01
问题 I want to set the high priority on the script below (only first). Another important thing is whether you can do a Radom Sleep, 250 to 350 ?? Loop { { ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, mor.png bT:= ErrorLevel ? bT : 1 If bT { bT:= 0 Random, x, 1130, 1300 Random, y, 580, 680 Click % x % % y % Sleep, 500 } } ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, biz.png bT:= ErrorLevel ? bT : 1 { bT:= 0 Random, x, 540, 618 Random, y, 419, 430 Click % x % % y % } } Return f1::

Remove last n characters of string after the dot with Autohotkey

回眸只為那壹抹淺笑 提交于 2019-12-13 19:19:47
问题 I am using Autohotkey. I have a string that looks like this S523.WW.E.SIMA . I want to remove the last few characters of the string after the dot (including the dot itself). So, after the removal, the string will look like S523.WW.E . This may look like a simple question but I just cannot figure out using the available string functions in Autohotkey. How can this be done using Autohotkey? Thank you very much. 回答1: Example 1 (last index of) string := "S523.WW.E.SIMA" LastDotPos := InStr(string

Can I list several keys to perform the same action? [AHK]

試著忘記壹切 提交于 2019-12-13 13:53:02
问题 AHK allows to bind keys, that is us a::z t fire 'z' whenever 'a' is pressed. What if I want to fire 'z' whenever 'a', 'b', or 'c' is pressed? I can obviously repeat my code: a::z b::z c::z I can probably use a Gosub like a::Gosub, abc b::Gosub, abc c::Gosub, abc abc: send z return Is there a better way to say "if a,b, or c are pressed - fire z"? 回答1: You can just use a:: b:: c::z i am not sure what is the exact synthax, but this works. 回答2: We're at codegolf.stackexchange.com, right? JFF,

RegEx: Match everything up to the last space without including it

。_饼干妹妹 提交于 2019-12-13 13:26:57
问题 I'd like to match everything in a string up to the last space but without including it. For the sake of example, I would like to match characters I put in bold : RENATA T. GROCHAL So far I have ^(.+\s)(.+) However, it matches the last space and I don't want it to. RegEx should work also for other languages than English, as mine does. EDIT: I didn't mention that the second capturing group should not contain a space – it should be GROCHAL not GROCHAL with a space before it. EDIT 2: My new RegEx

How to determine title and additional infos from an open window for use with Autohotkey?

自作多情 提交于 2019-12-13 08:49:38
问题 To access and control a window, dialog or popup with Autohotkey the title of that specific window is needed. For some windows the title can be read directly if its visible, but some windows hide it. The window class and the exe (ahk_class and ahk_exe) aren't visible at all. How to gather this information reliable? 回答1: Use the Window Spy tool, which is installed together with AHK, it can be started various ways: Right click the tray icon of a running AHK script and select Window Spy Start the

Autohotkey - virtual keyboard / AutoInput

。_饼干妹妹 提交于 2019-12-13 08:26:54
问题 I have this simply script in Autohotkey: :*:teams:: ( milan juventus inter roma lazio napoli mantova ) When i type teams on Notepad my output is the list of teams (milan, juventus..) if i use a physical keyboard to type teams this script work for me , but if use a virtual keyboard to type teams i have no list on Notepad: and if i run the script to type teams automatically WinWait, *new 2 - Notepad++, IfWinNotActive, *new 2 - Notepad++, , WinActivate, *new 2 - Notepad++, WinWaitActive, *new 2

Looping clipboard and errorlevel evaluation not working as expected

瘦欲@ 提交于 2019-12-13 06:51:08
问题 while clipboard = { SendEvent, ^{ins} ;^c doesn't work sleep 50 } clipWait, 2 ; Wait for the clipboard to contain text. if ErrorLevel { ;endEvent, ^{ins} MsgBox Failed to save the selection: %clipboard% ;exit } Problem: ErrorLevel still gets evaluated as true, whereas the loop shouldn't finish unless something came inside the clipboard. How is this possible? Clarification: This construction was made as an attempt to answer question: SendEvent ^{ins} isn't copying content to the clipboard As