Search found 391 matches
- Yesterday, 21:02
- Forum: Ask for Help (v2)
- Topic: Send the output of program execution to a variable Topic is solved
- Replies: 6
- Views: 331
Re: Send the output of program execution to a variable Topic is solved
Albireo I believe this method is the cleanest, but I don't fully understand the code. I'm especially unsure about the WScript.Shell part, as it is outside the scope of AHK. Please take note of this. #Requires AutoHotkey v2.0 #SingleInstance Force result := getHiddenCommandOutput("dir C:\") msgbox ...
- 15 May 2024, 18:58
- Forum: Ask for Help (v2)
- Topic: StrReplace Chinese characters help
- Replies: 4
- Views: 277
Re: StrReplace Chinese characters help
Are there any other ways to specify a Chinese character? Yes, there are other methods, but ultimately, that would involve specifying the Unicode range directly. The most widely known range is called CJK Unified Ideographs , which spans from U+4E00 to U+9FFF. Represented in regex, it would be somet...
- 15 May 2024, 15:58
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
Re: Assign a function to a double middle click press? Topic is solved
Milincho Sure, just to clarify, I didn't touch any keyboard-related parts in either the first or second code snippets I provided. So, I genuinely share your confusion. However, I do have a suspicion that the state of the modifier keys sent via Send might be causing interference. As for my original...
- 15 May 2024, 15:42
- Forum: Ask for Help (v2)
- Topic: Can I determine if the Always property has been used in SetCapsLockState? Topic is solved
- Replies: 2
- Views: 239
Can I determine if the Always property has been used in SetCapsLockState? Topic is solved
Does anyone have a good idea for achieving this without resorting to send ing CapsLock and observing the reaction? I'm hoping for something like a magic trick using SendMessage to the main AHK script or similar methods. (If not, I'll have to trace every instance of SetCapsLockState in tens of thous...
- 15 May 2024, 15:09
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
- 15 May 2024, 14:22
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
Re: Assign a function to a double middle click press? Topic is solved
If I don't consider beginners and write code at my full potential, it would look like this. #Requires AutoHotkey v2.0 #SingleInstance Force MButtonRemapping.InputIntervalTick := 250 #HotIf *~MButton:: MButtonRemapping.onPress() #HotIf MButtonRemapping.IsContinuousInput *MButton:: MButtonRemapping.o...
- 15 May 2024, 13:51
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
Re: Assign a function to a double middle click press? Topic is solved
*~MButton::
Hotkey Modifier Symbols
Hotkey Modifier Symbols
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
i := 0
*~MButton:: {
global i
++i
setTimer(check, -250)
}
check() {
global i
if (i == 2)
send("^!y")
i := 0
}
- 15 May 2024, 11:07
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
Re: Assign a function to a double middle click press? Topic is solved
Code: Select all
; TO DO
Code: Select all
send("^!y")
- 15 May 2024, 10:08
- Forum: Ask for Help (v2)
- Topic: Assign a function to a double middle click press? Topic is solved
- Replies: 19
- Views: 619
Re: Assign a function to a double middle click press? Topic is solved
I'm not sure about your coding skills, so I've kept it as simple as possible for now. Questions are always welcome. #Requires AutoHotkey v2.0 #SingleInstance Force i := 0 *MButton:: { global i ++i setTimer(check, -250) } check() { global i if (i == 2) { tooltip("Double Middle Click") setTimer(toolt...
- 15 May 2024, 09:21
- Forum: Ask for Help (v2)
- Topic: how to list the keys, methods and properties of object in Autohotkey v2?
- Replies: 2
- Views: 214
Re: how to list the keys, methods and properties of object in Autohotkey v2?
#Requires AutoHotkey v2.0 #SingleInstance Force class MyZooClass { ;in AHK v1 this is a key(/value property): ;in AHK v2 this is a value property: MyValueProperty := "MyValuePropertyValue" ;in AHK v1 this is a key(/value property): ;in AHK v2 this is a value property: static MyStaticProperty := "My...
- 15 May 2024, 08:36
- Forum: Ask for Help (v2)
- Topic: RegEx WinActive() quick help
- Replies: 1
- Views: 157
Re: RegEx WinActive() quick help
Not tested. #Requires AutoHotkey v2.0 #SingleInstance Force #HotIf HotIfCond.F2 F2:: { } #HotIf class HotIfCond { static F2 { get { prevTMM := setTitleMatchMode("RegEx") result := winExist("\d{3}"), setTitleMatchMode(prevTMM) return result } } } #Requires AutoHotkey v2.0 #SingleInstance Force #HotI...
- 15 May 2024, 04:29
- Forum: Ask for Help (v2)
- Topic: best way to escape := (' ? Topic is solved
- Replies: 3
- Views: 162
Re: best way to escape := (' ? Topic is solved
Code: Select all
var := '
(Join_
セ
ブ
ン
)'
Code: Select all
var :=
(
'セ'
'_ブ'
'_ン'
)
Code: Select all
var := ''
. 'セ'
. '_ブ'
. '_ン'
セ_ブ_ン
Code: Select all
var := '
(
(
`)
)'
(
)
- 15 May 2024, 04:21
- Forum: Ask for Help (v2)
- Topic: best way to escape := (' ? Topic is solved
- Replies: 3
- Views: 162
Re: best way to escape := (' ? Topic is solved
Because the outermost parentheses of the code are unnecessary in this case (as the expression or operation order is not a concern), and the syntax for specifying multi-line strings is precisely agreed upon as follows. Please refer to the document titled Splitting a Long Line into a Series of Shorte...
- 14 May 2024, 16:39
- Forum: Ask for Help (v2)
- Topic: Right Alt and Shift
- Replies: 1
- Views: 101
Re: Right Alt and Shift
Code: Select all
>!+a::send("{U+00D6}") ; RAlt + Shift + A
>!s::send("{U+00DF}") ; RAlt + S
- 14 May 2024, 15:23
- Forum: Ask for Help (v2)
- Topic: Hotkeys to switch betwen labels v2 Topic is solved
- Replies: 7
- Views: 365
Re: Hotkeys to switch betwen labels v2 Topic is solved
Jinjiro Goto is almost taboo for beginners learning programming. In fact, many might not even teach it, and if they do, there's always a warning against its usage. The use of Goto is discouraged because it generally makes scripts less readable and harder to maintain. Consider using Else , Blocks ,...
- 14 May 2024, 03:25
- Forum: Ask for Help (v2)
- Topic: Can the text color of a radio button be changed? Topic is solved
- Replies: 8
- Views: 376
Re: Can the text color of a radio button be changed? Topic is solved
I thought I could easily write it because I've done similar tasks in v1, but surprisingly, there were some grammar changes from v2, so it took me a bit of time. This is more of a conceptual demonstration to show what you desire is possible. In reality, it needs a bit more refinement. #Requires Auto...
- 13 May 2024, 18:08
- Forum: Ask for Help (v2)
- Topic: StrReplace Chinese characters help
- Replies: 4
- Views: 277
Re: StrReplace Chinese characters help
Code: Select all
haystack := "“你好”`r`n“祝你有个美好的一天”"
msgbox A_Clipboard := editSubtitle(haystack)
editSubtitle(haystack) {
newStr := haystack
newStr := regExReplace(newStr, "“(?=\p{Han})", " ${0}")
newStr := regExReplace(newStr, "(?<=\p{Han})”", "${0} ")
return newStr
}
- 13 May 2024, 17:24
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1097
Re: String Manipulation between ^ and /
#Requires AutoHotkey v2.0 #SingleInstance Force needle := "\^(?P<Lname>\w+)/(?P<Fname>\w+)" haystacks := ["54545454^Lname/Fname ^5646416516511" ,"54545454^Lname/Fname^5646416516511" ,"54545454^Lname/Fname M.I. ^5646416516511"] for haystack in haystacks { if (regExMatch(haystack, needle, &m)) msgBox...
- 13 May 2024, 07:03
- Forum: Ask for Help (v2)
- Topic: Hotkeys to switch betwen labels v2 Topic is solved
- Replies: 7
- Views: 365
Re: Hotkeys to switch betwen labels v2 Topic is solved
Jinjiro As the language moved from version 1 to version 2, the Gosub command was completely removed, but the Goto command survived because maybe, there are still limited scenarios where it might be useful. To my knowledge, this command can be effectively used to escape from multiple loops. It coul...
- 13 May 2024, 01:14
- Forum: Ask for Help (v2)
- Topic: This is the gui phrase I used in v1, but I want to change it to the v2 version.
- Replies: 4
- Views: 242
Re: This is the gui phrase I used in v1, but I want to change it to the v2 version.
Gui creation code can be written succinctly as follows. btnFindExcel := myGui.add("Button", "w400", "Find Excel") btnFindExcel.onEvent("Click", btnFindExcel_Click) btnExcelsetting := myGui.add("Button", "w400", "Excel Setting") btnExcelsetting.onEvent("Click", btnExcelSetting_Click) myGui.add("But...