Search found 453 matches

by Osprey
20 Apr 2019, 02:55
Forum: Ask For Help
Topic: How to create this kind of menu with sub menus Topic is solved
Replies: 4
Views: 187

Re: How to create this kind of menu with sub menus Topic is solved

You're right. I forgot that it's for all context menus, not just on tray icons. I've used it a few times, but I haven't needed submenus, so I can't help you there.
by Osprey
20 Apr 2019, 01:27
Forum: Ask For Help
Topic: Multiline WinText Parameter
Replies: 7
Views: 244

Re: Multiline WinText Parameter

ExcludeText is supported with the WinActive function and you can use functions with #If, like so: #If WinActive("ahk_exe CPRSChart.exe", "A Page") ; Match CPRSChart.exe windows that contain "A Page" ;hotkeys for Window A #If WinActive("ahk_exe CPRSChart.exe", "B Page",, "A Page") ; Match CPRSChart.e...
by Osprey
19 Apr 2019, 23:19
Forum: Ask For Help
Topic: How to Loop For Specific Time
Replies: 4
Views: 172

Re: How to Loop For Specific Time

You could use Loop (until) combined with A_TickCount, like so:

Code: Select all

StartTime := A_TickCount
Loop {
	If GetKeyState("LButton", "LCtrl") {
		Sleep, 6
		mouseXY(3,3)
	}
	else break
} Until A_TickCount - StartTime > 60000	; Loop until 60 seconds have passed
by Osprey
19 Apr 2019, 22:22
Forum: Ask For Help
Topic: Multiline WinText Parameter
Replies: 7
Views: 244

Re: Multiline WinText Parameter

It sounds like the ExcludeText parameter would help you. Set "A Page" as the ExcludeText parameter when you want to target Window B and set "A Page" as the WinText parameter when you want to target Window A.
by Osprey
19 Apr 2019, 22:14
Forum: Ask For Help
Topic: Google Translate code slow and erroneous
Replies: 19
Views: 1880

Re: Google Translate code slow and erroneous

Many thanks to teadrinker for his script. I've slightly modified it in a few ways to suit my purposes, but also make it more adaptable for others: 1. It'll now automatically translate to the user's system language. In other words, if you don't supply any parameters to the GoogleTranslate function ot...
by Osprey
19 Apr 2019, 19:37
Forum: Ask For Help
Topic: How to create this kind of menu with sub menus Topic is solved
Replies: 4
Views: 187

Re: How to create this kind of menu with sub menus Topic is solved

The Menu command is for defining the menu when you click on a tray icon. You probably want a normal application window, right? If so, you likely want to create a GUI with the Gui command. Look up how to make a Gui control called DropDownList. You can detect right clicking on menus by reading if A_Gu...
by Osprey
18 Apr 2019, 22:51
Forum: Ask For Help
Topic: Log the PID of an active window
Replies: 1
Views: 177

Re: Log the PID of an active window

It sounds like you need a loop that waits until the current window is no longer active. This quick example should get you started: Loop { WinGetActiveTitle, ActiveWindow ; Store the currently active window's title in ActiveWindow WinGet, ActiveWinPID, PID, %ActiveWindow% ; Get the PID for the curren...
by Osprey
18 Apr 2019, 22:35
Forum: Ask For Help
Topic: Remapping a key and making it do a different. [HELP]
Replies: 1
Views: 111

Re: Remapping a key and making it do a different. [HELP]

Remapping (doing a::b) is making one key act like another and nothing more. It's not flexible. For the flexibility that you want, you want to create a hotkey. Try: 1::Send, {Left}{Click 2} If you want to add more to it than that, you may need to expand it to multi-line syntax like so: 1:: Send, {Lef...
by Osprey
18 Apr 2019, 03:11
Forum: Ask For Help
Topic: Counting how many times item is in string Topic is solved
Replies: 9
Views: 218

Re: Counting how many times item is in string Topic is solved

If you'd rather keep what you're already written, do: text = ( 1 1 5 1 3 9 10 11 3 4 3 26 26 6 2 12 2 7 2 6 10 ) pos=1 While pos := RegExMatch(text,"\b\d+\b",m,pos+StrLen(m)) n .= (!n ? "" : "`n") m Sort, n, U N Loop, parse, n, `n, `r RegExReplace(text,"\b" A_LoopField "\b","$0",count), out .= count...
by Osprey
17 Apr 2019, 23:59
Forum: Ask For Help
Topic: A control's variable must be global or static Topic is solved
Replies: 6
Views: 323

Re: A control's variable must be global or static Topic is solved

They don't. You're putting your Gui inside of a function, and variables inside functions are local by default. It has nothing to do with it being a Gui or a certain type of Gui control.
by Osprey
16 Apr 2019, 18:56
Forum: Ask For Help
Topic: Move Mouse
Replies: 2
Views: 115

Re: Move Mouse

Do you have SendMode, Input or SendMode, Play anywhere above? MouseMove ignores the Speed parameter when the script's Send mode is set to Input or Play. When used with the default mode, Event, MouseMove, 40, 50, 100 moves the mouse slowly for me, as expected. If you don't want to change the mode for...
by Osprey
16 Apr 2019, 18:48
Forum: Ask For Help
Topic: Multiline WinText Parameter
Replies: 7
Views: 244

Re: Multiline WinText Parameter

I think that each line of the "Text" field in WindowSpy is its own text string. For example, if you have two buttons on your GUI, the first line of the Text field would be the text of the first button and the second line would be the text of the second button. I'm not sure if or how you should combi...
by Osprey
14 Apr 2019, 17:32
Forum: Ask For Help
Topic: Mapping arrow keys to scroll wheel
Replies: 3
Views: 153

Re: Mapping arrow keys to scroll wheel

So you have to simulate the up AND down for each key? LOL! Ok that probably just makes autohotkey really powerful for some reasons and actions that don't apply to me. You don't always have to do it. You could just do a::b to make the 'b' key act like the 'a' key. The wheel scroll actions are differ...
by Osprey
14 Apr 2019, 17:14
Forum: Ask For Help
Topic: How to get functions to work with variables
Replies: 3
Views: 148

Re: How to get functions to work with variables

It looks like Scan and Decision are subroutines, not functions. You don't need to worry about variable scope because they'll automatically have access to the same variables.
by Osprey
14 Apr 2019, 16:12
Forum: Ask For Help
Topic: Putting characters before and after text Topic is solved
Replies: 16
Views: 425

Re: Putting characters before and after text Topic is solved

My idea is similar to Joe's, but does what the TooltipKeypress script does and creates hotkeys for each key programatically: Loop, 5000 { Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), GetText ; Create lowercase hotkeys Hotkey, % "~*+" GetKeyName(Format("vk{:x}", a_index - 1)), GetText ; ...
by Osprey
14 Apr 2019, 15:01
Forum: Ask For Help
Topic: Mapping arrow keys to scroll wheel
Replies: 3
Views: 153

Re: Mapping arrow keys to scroll wheel

Try this:

Code: Select all

#IfWinActive ahk_class Azumanga Main Window
wheelup::
SendInput, {up down}
Sleep, 100
SendInput, {up up}
return
wheeldown::
SendInput, {down down}
Sleep, 100
SendInput, {down up}
return
Increase or decrease the sleep time to adjust how long the up and down keys should be pressed.
by Osprey
12 Apr 2019, 09:54
Forum: Ask For Help
Topic: Combining two LButton scripts
Replies: 1
Views: 63

Re: Combining two LButton scripts

Well, they both appear to do things as long as the left button is held down, so it doesn't seem too tricky. I would start with the second one, since it's a lot nicer looking and add the key parts of the first to it, like so: f1::Suspend *~$LButton:: while GetKeyState("LButton") { DllCall("mouse_even...
by Osprey
11 Apr 2019, 19:33
Forum: Ask For Help
Topic: add combo box options
Replies: 2
Views: 86

Re: add combo box options

Is this what you're trying to achieve?: Gui, Add, Tab2,w400 h588 w390 x5, Daily Gui, Font, s12 Gui, Add, DropDownList, x20 y40 w120 vMain_Grp gMain_Grp, General||Human|Music|Noise| Gui, Add, DropDownList, x180 y40 w120 vSub_Grp gSub_Grp, GeneralSub1||GeneralSub2|GeneralSub3|GeneralSub4| Gui, Add, Ed...
by Osprey
11 Apr 2019, 18:32
Forum: Ask For Help
Topic: How to save variables after script ends Topic is solved
Replies: 9
Views: 291

Re: How to save variables after script ends Topic is solved

I suggest simply using RegRead and RegWrite to read and write the variable to the registry. That's what the registry is for, after all. It's a single place for Windows and any apps to store their settings. For example, if I were you, I'd do: ScriptName := "My Script" RegRead, i, HKEY_CURRENT_USER\SO...
by Osprey
11 Apr 2019, 05:25
Forum: Ask For Help
Topic: Object Centered In Gui Topic is solved
Replies: 8
Views: 259

Re: Object Centered In Gui Topic is solved

If you're asking if there's a way as simple as the one that's possible with the Text control, I'm not aware of one. I could be wrong, though.

Go to advanced search