Search found 6721 matches

by jeeswg
03 Oct 2019, 16:55
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13939

Re: your personal AutoHotkey style guide

- I tend to find that the while-condition or until-condition tend to bring in a bit of uncertainty to code. You could get off-by-one errors as a result. - (I use 'while' occasionally, I never use 'until'.) - I find that using 'Loop' (indefinite) or 'Loop count', with an if-statement to cause the bre...
by jeeswg
02 Oct 2019, 20:49
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 100
Views: 13939

Re: your personal AutoHotkey style guide

- Are there are crossover examples? - It throws on an error (try/catch/finally/OnError) or it doesn't (return value/ErrorLevel/A_LastError). - Generally speaking, I'd write all of my functions to return error values, and not use throw, and thus not force the user to use try/catch etc. - That said, I...
by jeeswg
02 Oct 2019, 13:19
Forum: Scripts and Functions
Topic: swap bytes
Replies: 1
Views: 555

Re: swap bytes

- A NumSplit function might be a better idea. It takes the integer and creates an array with one item per byte. - A 'NumJoin' function wouldn't be necessary, you could just use Format. Cheers. ;q:: ;test number split / number join ;note: NumSplit creates an array of 8 items, bytes in LE order, by de...
by jeeswg
02 Oct 2019, 11:34
Forum: Ask For Help
Topic: Reading Win 10 File Explorer View Mode
Replies: 8
Views: 2183

Re: Reading Win 10 File Explorer View Mode

@joefiesta: The menu item IDs that I use with PostMessage, are usually obtained using this script: Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=6&t=31971 Sometimes I use IDs that I obtained from menus on *Windows XP*, that still...
by jeeswg
01 Oct 2019, 08:52
Forum: Wish List
Topic: Wish List 2.0
Replies: 18
Views: 7465

Re: Wish List 2.0

- The list hasn't changed much in the past year. - However, I have reordered the initial content using 'IMPORTANT' sections. - And I have reviewed the entire document, clarifying occasional points. - With long path support added in AHK v1, my remaining priorities are generally pretty simple to imple...
by jeeswg
30 Sep 2019, 22:56
Forum: Ask For Help
Topic: is ErrorLevel a reserved word ?
Replies: 7
Views: 354

Re: is ErrorLevel a reserved word ?

Run this two-line script on AHK v1, and it lists A_Args and ErrorLevel: ListVars MsgBox ;AHK v1: ;0, A_Args ;ErrorLevel ;AHK v2: ;A_Args ;Array, Class, Map, Object ;ErrorLevel Here's a script to test if variables are writable: ;test if variables are writable vList := " ;continuation section ( A_Args...
by jeeswg
30 Sep 2019, 21:04
Forum: Ask For Help
Topic: is ErrorLevel a reserved word ?
Replies: 7
Views: 354

Re: is ErrorLevel a reserved word ?

- And what about your first post? Is that misleading? ErrorLevel has a special role, but is not a reserved keyword. (Admittedly, the title seems to ask, is it reserved, and the OP seems to ask, does it have a special role.) - To your point, I advised against using ErrorLevel as a regular variable in...
by jeeswg
30 Sep 2019, 19:20
Forum: Ask For Help
Topic: is ErrorLevel a reserved word ?
Replies: 7
Views: 354

Re: is ErrorLevel a reserved word ?

- AFAIK, in AHK v1, A_Args and ErrorLevel are normal super-global variables. But I would avoid considering/treating them as regular variables. - (You can define a variable as super-global by doing global var := "value" outside of a function definition.) - (In AHK v1, you cannot write to built-in var...
by jeeswg
29 Sep 2019, 20:09
Forum: Scripts and Functions
Topic: Acc: get text from all window/control elements
Replies: 22
Views: 5233

Re: Acc: get text from all window/control elements

@potroveio: I updated the Chrome functions, here:
Firefox/Chrome, get tab names/focus tab - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947&p=294316#p294316
by jeeswg
29 Sep 2019, 19:57
Forum: Ask For Help
Topic: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)
Replies: 5
Views: 330

Re: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)

- @lexikos: Thanks for the info. - Hmm. I suppose that: if we use BM_SETCHECK to toggle the Notepad Find dialog 'Match case' checkbox, Notepad isn't notified, but when we click 'Find Next' to search, Notepad is notified (about that button), and I'm guessing that the code is written such that it retr...
by jeeswg
29 Sep 2019, 19:11
Forum: Ask For Help
Topic: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)
Replies: 5
Views: 330

Re: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)

- @rommmcek: What I'm interested in is *clicking* a control, without *focusing* the control. If you use ControlSetChecked or ControlClick, they have the side effect of changing the keyboard focus to that control. BM_SETCHECK ticks/unticks the checkbox, without focusing the checkbox. - Btw you could ...
by jeeswg
29 Sep 2019, 18:35
Forum: Scripts and Functions
Topic: Firefox/Chrome, get tab names/focus tab
Replies: 30
Views: 12199

Re: Firefox/Chrome, get tab names/focus tab

- Hello potroveio! I've updated the Chrome functions to work with v77. - I've also added a few functions. - [EDIT: 2019-10-01] And added Firefox equivalents that work with v69. - Note: JEE_ChromeAccInit is where I now store the Acc paths, so if the Acc paths change again in future, you'll only have ...
by jeeswg
29 Sep 2019, 14:03
Forum: General Discussion
Topic: Exit and ExitApp - are they control flow statements?
Replies: 3
Views: 238

Re: Exit and ExitApp - are they control flow statements?

I maintain a list here: list of every command/function/variable from across all versions - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=74&t=27321&p=131642#p131642 Although I'm uncertain re. whether Case and Default should be considered control flow statements, I've asked here:...
by jeeswg
29 Sep 2019, 13:17
Forum: Wish List
Topic: Suggestions on documentation improvements
Replies: 614
Views: 142157

Re: Suggestions on documentation improvements

CONTROLSETCHECKED (CONTROL CHECK/UNCHECK) FOCUSES CONTROLS - Re.: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=5&t=68413 - The AHK v1/v2 documentation should mention that ControlSetChecked has the side effect of *focusin...
by jeeswg
29 Sep 2019, 12:24
Forum: General Discussion
Topic: Exit and ExitApp - are they control flow statements?
Replies: 3
Views: 238

Re: Exit and ExitApp - are they control flow statements?

Did you ask something like this before somewhere? Exit and ExitApp are commands in AHK v1, and functions in AHK v2. Alphabetical Function Index | AutoHotkey v2 https://lexikos.github.io/v2/docs/commands/index.htm Admittedly, they do have a control flow statement-like role. Although one wonders how f...
by jeeswg
29 Sep 2019, 12:16
Forum: Ask For Help
Topic: check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)
Replies: 5
Views: 330

check/uncheck Button controls (BM_SETCHECK v. BM_CLICK)

INTRO - ControlSetChecked (AHK v2) and Control Check/Uncheck (AHK v1), check/uncheck(tick/untick) the checkbox in a Button control. - The functions/subcommands, which use BM_CLICK in the source code, have the side effect of *focusing* the control. - BM_SETCHECK does not have this side effect. - [EDI...
by jeeswg
29 Sep 2019, 10:45
Forum: Ask For Help
Topic: Mute returns from functions - should we avoid them?
Replies: 6
Views: 501

Re: Mute returns from functions - should we avoid them?

- I've tried to answer your question, do post more info if I haven't quite answered it. - A function's return value is typically a numerical error(/success) code. - But it can also be the value you want to return. - E.g. ControlGetText could legitimately be a blank string, if the control is empty. -...
by jeeswg
28 Sep 2019, 22:15
Forum: AutoHotkey v2 Help
Topic: [a104] are builtin classes protected against accidental overwriting? Topic is solved
Replies: 23
Views: 1408

Re: [a104] are builtin classes protected against accidental overwriting? Topic is solved

- While I appreciate that there may be some key issues you haven't mentioned, I see it like this ... - In short, I see advantages in thinking of class definitions as like function definitions. Function names do not clash with the variable namespace, and you can create a function reference/check for ...
by jeeswg
28 Sep 2019, 20:16
Forum: AutoHotkey v2 Help
Topic: [a104] are builtin classes protected against accidental overwriting? Topic is solved
Replies: 23
Views: 1408

Re: [a104] are builtin classes protected against accidental overwriting? Topic is solved

- Class names could use a separate namespace (a bit like window groups in AHK v1). - And could be accessed via something like: ArrayClass := GetClass("Array") - With 'ClassB extends ClassA' remaining as before. - (Further advantages: you don't have to declare the class variable as global, and, where...
by jeeswg
28 Sep 2019, 19:19
Forum: Ask For Help
Topic: GetKeyState functionality not working Version 1.1.30.03
Replies: 4
Views: 147

Re: GetKeyState functionality not working Version 1.1.30.03

This worked for me:

Code: Select all

#If GetKeyState("Alt", "P") && GetKeyState("CapsLock", "P")
;~Capslock & [::
*[::
    SendInput, +^{Left}
    Sleep, 50
Return

;~Capslock & ]::
*]::
    SendInput, +^{Right}
    Sleep, 50
Return
#If

Go to advanced search