Search found 6273 matches

by jeeswg
07 May 2019, 04:47
Forum: Ask For Help
Topic: judge var isArray or isObject?
Replies: 6
Views: 158

Re: judge var isArray or isObject?

You could have: non-integer key count = gap count.

Code: Select all

oArray := ["a", "b", "c"]
MsgBox, % oArray.Length() " " oArray.Count() ;3 3
oArray := {1:"a", 3:"c", x:"x"}
MsgBox, % oArray.Length() " " oArray.Count() ;3 3
by jeeswg
07 May 2019, 04:43
Forum: Wish List
Topic: Num / IsNum / Int / Float / Str
Replies: 2
Views: 188

Num / IsNum / Int / Float / Str

ISNUM AND NUM - IsNum(Num) would be a shorthand for (Num is "number") . I.e. 'looks numeric'. - (An extra Options parameter could have various letter options: e.g. looks like a Float (F), looks like an Integer (I), possibly has a specific type.) - (Generally, I find some 'is' operator types a bit am...
by jeeswg
07 May 2019, 04:14
Forum: Ask For Help
Topic: judge var isArray or isObject?
Replies: 6
Views: 158

Re: judge var isArray or isObject?

Perhaps something like this for IsArray. If anyone can point out any improvements, please do. ;requires AHK v1.1.29+ ;has integer keys 1 to n with no gaps, or is an empty object IsArray(oArray) { local if !ObjCount(oArray) return 1 if !(ObjCount(oArray) = ObjLength(oArray)) || !(ObjMinIndex(oArray) ...
by jeeswg
07 May 2019, 03:53
Forum: Ask For Help
Topic: controlsend problems (Help!)
Replies: 14
Views: 243

Re: controlsend problems (Help!)

Did you try my script by itself, on a folder containing say a few files, that was already the active window.

Perhaps you need to wait a while before the folder is ready. Perhaps you could get the file count via Loop Files, and check oWin.Document.Folder.Items.count repeatedly until it matches.
by jeeswg
07 May 2019, 03:24
Forum: Ask For Help
Topic: controlsend problems (Help!)
Replies: 14
Views: 243

Re: controlsend problems (Help!)

Try specifying the path instead of the name.
Btw why do you want to select the file in a folder? I'd just open the file directly.
by jeeswg
07 May 2019, 03:04
Forum: Ask For Help
Topic: controlsend problems (Help!)
Replies: 14
Views: 243

Re: controlsend problems (Help!)

For the WinGet line, try: ahk_class CabinetWClass instead of A.
by jeeswg
07 May 2019, 02:14
Forum: Ask For Help
Topic: controlsend problems (Help!)
Replies: 14
Views: 243

Re: controlsend problems (Help!)

Re. jumping around: when sending literal text use {Raw} or {Text}. Although, even if you can get it to work, I'd still use the COM approach, as sending keys can be risky.
by jeeswg
07 May 2019, 00:24
Forum: Ask For Help
Topic: Script to create and open a new text file? Topic is solved
Replies: 6
Views: 215

Re: Script to create and open a new text file? Topic is solved

This will create a text file inside the active Explorer window. #IfWinActive, ahk_class CabinetWClass q:: ;explorer - create new text file and open it with Notepad2 #IfWinActive, ahk_class ExploreWClass q:: ;explorer - create new text file and open it with Notepad2 vPathNotepad2 := "C:\Program Files...
by jeeswg
06 May 2019, 23:53
Forum: Ask For Help
Topic: controlsend problems (Help!)
Replies: 14
Views: 243

Re: controlsend problems (Help!)

- In these types of situations, I'd try sending keys to every control. You can use WinGet ControlList. - I might also try ControlGetFocus. - This worked for me: q:: ;explorer - send keys WinGet, hWnd, ID, ahk_class CabinetWClass ControlFocus, DirectUIHWND3, % "ahk_id " hWnd ControlGetFocus, vCtlClas...
by jeeswg
06 May 2019, 23:30
Forum: Ask For Help
Topic: 【help】set time"%A_YYYY%" without first two letters"YY"?
Replies: 2
Views: 64

Re: 【help】set time"%A_YYYY%" without first two letters"YY"?

Here are 2 ideas. I'd use the FormatTime approach, as it's more reliable. E.g. if you concatenate variables, and if it's midnight when you get the time, you could end up with the correct day, but the previous month. :*:dd:: SendInput, % SubStr(A_YYYY "-" A_MM "-" A_DD, 3) return :*:d2:: FormatTime, ...
by jeeswg
05 May 2019, 19:59
Forum: Scripts and Functions
Topic: log hotkeys, get extended hotkey info, interact with the *right* window (Hotkey command with FunctionObject example)
Replies: 3
Views: 796

Re: log hotkeys, get extended hotkey info, interact with the *right* window (Hotkey command with FunctionObject example)

Here's a basic AutoHotkey v2 script written in a C++ style. Everything is stored within functions, to avoid polluting the global namespace. And the use of hotkey labels has been avoided, instead, the Hotkey function is used. ;AHK v2 script #SingleInstance force Main() Main() { MsgBox("hello world") ...
by jeeswg
05 May 2019, 19:36
Forum: Scripts and Functions
Topic: log hotkeys, get extended hotkey info, interact with the *right* window (Hotkey command with FunctionObject example)
Replies: 3
Views: 796

Re: log hotkeys, get extended hotkey info, interact with the *right* window (Hotkey command with FunctionObject example)

Here's a basic example for the If, % FunctionObject functionality: ;'If, % FunctionObject' example ;pressing q will give a different message if the active window is Notepad/WordPad/other ;note: ;If, % FunctionObject ;FunctionObject must be a single variable (not an expression) ;fn := Func("MyWinActi...
by jeeswg
05 May 2019, 19:02
Forum: Ask For Help
Topic: Script to create and open a new text file? Topic is solved
Replies: 6
Views: 215

Re: Script to create and open a new text file? Topic is solved

Something like this: q:: ;create a blank text file, open it with Notepad2 vPathNotepad2 := "C:\Program Files\Notepad2\Notepad2.exe" ;use the same filename each time: ;vPath := A_Desktop "\z my txt.txt" ;choose a filename based on the current time: vPath := A_Desktop "\z " A_Now ".txt" ;do nothing if...
by jeeswg
05 May 2019, 18:53
Forum: Ask For Help
Topic: Remove border from Progress? Topic is solved
Replies: 15
Views: 311

Re: Remove border from Progress? Topic is solved

- Thanks for the script, I tried with/without the png. I tested on Windows 7. I didn't see any border, and couldn't see one even after printscreening and zooming in. - So maybe you could give a better example script to demonstrate the problem, or a printscreen. - If nothing else works, you could try...
by jeeswg
05 May 2019, 17:49
Forum: Ask For Help
Topic: Remove border from Progress? Topic is solved
Replies: 15
Views: 311

Re: Remove border from Progress? Topic is solved

Some other styles to consider, that the window has: WS_BORDER := 0x800000 WS_DLGFRAME := 0x400000 WS_EX_WINDOWEDGE := 0x100 Presumably you are tiling controls, so it would be better to give some example code that shows this. It's hard to observe anything if the control is the same size as the window...
by jeeswg
05 May 2019, 17:40
Forum: Ask For Help
Topic: Can AHK Copy page title and url?
Replies: 3
Views: 146

Re: Can AHK Copy page title and url?

There's code here to get the title/url for the active tab in Firefox/Chrome: Firefox/Chrome, get tab names/focus tab - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=6&t=26947 There's code here to get the titles/urls for all tabs in Internet Explorer: jeeswg's Internet Explorer a...
by jeeswg
05 May 2019, 17:11
Forum: Ask For Help
Topic: Brainstorm With Me? Steam Screenshots Fldrs.
Replies: 4
Views: 126

Re: Brainstorm With Me? Steam Screenshots Fldrs.

Some ideas: - Use Loop Files to retrieve a list of folder names (game IDs), use Loop Files to retrieve the path of the first image file in each folder, show the image temporarily by using SplashImage, show an InputBox, where you type in the game's name, then store the folder names (game IDs) and gam...
by jeeswg
05 May 2019, 17:04
Forum: Ask For Help
Topic: Instr() DOES NOT WORK, ALWAYS TRUE
Replies: 4
Views: 140

Re: Instr() DOES NOT WORK, ALWAYS TRUE

You'd want to drop the %s: if InStr(filename, A_LoopField) Although there may still be other problems with the script. Here are two ideas. I generally prefer the array approach. q:: ;check if files exist (use comma-separated list) vNeedles := "1,22,333,4444,55555" ;files to search for vFiles := "22,...
by jeeswg
05 May 2019, 03:04
Forum: Ask For Help
Topic: Question about RegExMatch() Topic is solved
Replies: 13
Views: 266

Re: Question about RegExMatch() Topic is solved

Some ideas here:
simplest way to make a RegEx needle literal? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=30420
by jeeswg
05 May 2019, 01:43
Forum: Ask For Help
Topic: Question about RegExMatch() Topic is solved
Replies: 13
Views: 266

Re: Question about RegExMatch() Topic is solved

- Outside of a character class, you do not need to escape - or ] - Inside a character class, you always need to escape these 3 characters: -]\ , if intended literally. And you need to escape this character: ^ , if intended literally, but only if it is at the start of the character class. - Something...

Go to advanced search