Search found 320 matches

by Osprey
21 Mar 2019, 15:18
Forum: Ask For Help
Topic: How to use fuction return values in commands
Replies: 2
Views: 50

Re: How to use fuction return values in commands

Try:

Code: Select all

MsgBox % TimeStamp()
Preceding a statement with a single % and a space turns the whole statement into an expression, and expressions can call functions.
by Osprey
21 Mar 2019, 14:53
Forum: Ask For Help
Topic: Right-click command not working on Chrome window???
Replies: 8
Views: 164

Re: Right-click command not working on Chrome window???

It works just fine in Chrome for me. Perhaps you have an extension that's interfering with it. Try disabling all extensions.

Also, this goes without saying, but make sure that you're testing on a web page that doesn't disable right clicking. I simply tested on the tab displaying this thread.
by Osprey
21 Mar 2019, 14:39
Forum: Ask For Help
Topic: Displaying arbitrary variable in msgbox Topic is solved
Replies: 4
Views: 85

Re: Displaying arbitrary variable in msgbox Topic is solved

You're welcome. I've found the "% %Var%" trick to be very useful, especially in my GUIs, for dynamically retrieving the contents of variables. It may not be very intuitive at first, but it makes sense if you think of it as "the contents of a variable whose name is the contents of another variable." ...
by Osprey
21 Mar 2019, 14:27
Forum: Ask For Help
Topic: mousemove
Replies: 5
Views: 139

Re: mousemove

Try: MouseMove, A_CaretX - 5, A_CaretY + 5 A_CaretX and A_CaretY hold the current position of the text cursor. While text is highlighted (such as after a Find operation), the cursor is put at the upper-right corner of the selection (at least in my test). I chose to move it left 5 pixels and down 5 p...
by Osprey
21 Mar 2019, 14:18
Forum: Ask For Help
Topic: Displaying arbitrary variable in msgbox Topic is solved
Replies: 4
Views: 85

Re: Displaying arbitrary variable in msgbox Topic is solved

Change your msgbox line to "msgbox % %Value%" and then enter only "test2" (no percent signs) into the Edit box.
by Osprey
19 Mar 2019, 23:58
Forum: Ask For Help
Topic: User Selectable Hotkey
Replies: 25
Views: 805

Re: User Selectable Hotkey

2. I am unable to enter ^Space, +Space and Esc into a Gui Hotkey control (although if I store those values directly in the associated ini file with an editor, they do show up as the current values in the Hotkey control box the next time the Gui is run. Is there any 'trick' for getting the Hotkey co...
by Osprey
14 Aug 2018, 22:06
Forum: Tutorials
Topic: How to Make AHK Work in Most Games - The Basics
Replies: 17
Views: 36868

Re: How to Make AHK Work in Most Games - The Basics

In fullscreen DirectX games, if you try to take a screenshot or use the PixelGetColor, PixelSearch or ImageSearch commands, you may find (depending on the video card that you have) that they don't work and return only the color black or only the color white. All of those do work if the game is in wi...
by Osprey
17 Mar 2018, 17:19
Forum: Ask For Help
Topic: Trouble with Multiple Copy/Paste Function
Replies: 5
Views: 385

Re: Trouble with Multiple Copy/Paste Function

Try modifying the parameters of ClipWait. For example, try ClipWait, 2, 1. That's my only idea at the moment.
by Osprey
08 Feb 2018, 16:31
Forum: Ask For Help
Topic: How to place text cursor?
Replies: 4
Views: 326

Re: How to place text cursor?

You could automate the Find dialog, if the text viewer supports it... something like: Send, ^{home}^f ; Ctrl+Home moves the caret to the start of the document. Ctrl+F opens the Find dialog. WinWait, Find Send, Text string to find{enter}{esc}^{left} ; Enter begins the search. Esc closes the Find dial...
by Osprey
08 Feb 2018, 15:57
Forum: Ask For Help
Topic: How to place text cursor?
Replies: 4
Views: 326

Re: How to place text cursor?

You could do it by sending the left arrow key once while the text is still selected to un-select it and move the caret to the start of the line, then sending the right arrow key a number of times equal to the position that you retrieved with InStr.
by Osprey
08 Feb 2018, 15:50
Forum: Ask For Help
Topic: Trying to make advance SingleInstance force Topic is solved
Replies: 8
Views: 463

Re: Trying to make advance SingleInstance force Topic is solved

If I'm understanding your situation correctly, it's the same that I had and which I addressed with this little function: ; Check if a script of the same name is already running (from a different location) and, if so, close the older process CheckProcess() { PID := DllCall("GetCurrentProcessId") Proc...
by Osprey
08 Feb 2018, 15:27
Forum: Ask For Help
Topic: PixelSearch saying it found the right color even though it's not there
Replies: 2
Views: 167

Re: PixelSearch saying it found the right color even though it's not there

As Exaskryz suggested might be the case, your Errorlevel logic is backwards. PixelSearch returns 0 if the color is found and 1 if it was not found, so you need to do: if ErrorLevel { MsgBox, Color not found! break } else { tooltip, color currently found Sleep 500 tooltip } Note the removed exclamati...
by Osprey
05 Feb 2018, 19:18
Forum: Ask For Help
Topic: Get the key code of omen command center button Topic is solved
Replies: 10
Views: 2940

Re: Get the key code of omen command center button Topic is solved

Since it's an omen, have you tried a scan code of 666? ;)

Seriously, have you snooped around the registry yet to see if your keyboard driver has added any mappings to the registry?

https://www.experts-exchange.com/articl ... eyond.html
by Osprey
03 Feb 2018, 18:46
Forum: Ask For Help
Topic: "KeyWait" - press key valid only if ...
Replies: 3
Views: 246

Re: "KeyWait" - press key valid only if ...

I thought that you wanted KeyWait to trigger over the GUI. If you want it to trigger over the original window, I think that setting up a hotkey for "k" may be more suitable. Try this: ;loop ;{ ifwinactive ahk_group xxx { wingettitle, Light, A WinGetPos, x, y, w, h, A Gui, +Lastfound +Toolwindow ; +H...
by Osprey
03 Feb 2018, 16:09
Forum: Ask For Help
Topic: "KeyWait" - press key valid only if ...
Replies: 3
Views: 246

Re: "KeyWait" - press key valid only if ...

Try something like this: loop { ifwinactive ahk_group xxx { wingettitle, Light, A WinGetPos, x, y, w, h, A Gui, +Lastfound +Toolwindow iw:= w + 24 ih:= h + 24 w:= w + 42 h:= h + 42 x:= x - 2 - border_thickness k y:= y - 2 - border_thickness Gui, Color, FFFF00 Gui, -Caption WinSet, Region, 0-0 %w%-0 ...
by Osprey
03 Feb 2018, 15:09
Forum: Ask For Help
Topic: Get the key code of omen command center button Topic is solved
Replies: 10
Views: 2940

Re: Get the key code of omen command center button Topic is solved

Try the following script. It'll display the name, VK code and SC code for each key pressed. CoordMode, ToolTip, Screen CleanTimer := -3000 ; Must be a negative number (the timer will run only once) Loop, 5000 { Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), GetText Hotkey, % "~*" GetKeyNa...
by Osprey
03 Feb 2018, 04:29
Forum: Ask For Help
Topic: [Q] assignment and value
Replies: 4
Views: 316

Re: [Q] assignment and value

"^+s" is not alpha-numeric. You can see this by simplifying your code to: ProgramKey := [] ProgramKey.cmd := "^+s" temp := ProgramKey["cmd"] If temp is alnum MsgBox, That is alpha-numeric! The condition is not satisfied; whereas, if you change "^+s" to, simply, "s", it is satisfied. As for why your ...
by Osprey
03 Feb 2018, 03:49
Forum: Ask For Help
Topic: Get the current directory of the active program
Replies: 5
Views: 321

Re: Get the current directory of the active program

The first method detailed here should be something that's easily scriptable in AutoHotkey:

https://www.extendoffice.com/documents/ ... older.html
by Osprey
02 Feb 2018, 17:46
Forum: Ask For Help
Topic: Responsive GUI Topic is solved
Replies: 3
Views: 279

Re: Responsive GUI Topic is solved

Have you tried using the built-in A_ScreenWidth and A_ScreenHeight variables? GuiWidth := A_ScreenWidth*0.50 GuiHeight := A_ScreenHeight*0.50 Gui, New Gui, Show, W%GuiWidth% H%GuiHeight% Return GuiClose: ExitApp Return Replace "50" on each of the first two lines with the percentages that you actuall...

Go to advanced search