Search found 133 matches

by coffee
22 Feb 2024, 23:00
Forum: Ask for Help (v2)
Topic: [Q] How to enumerate user class methods
Replies: 2
Views: 83

Re: [Q] How to enumerate user class methods

Methods are typically excluded from enumeration in the two-parameter mode, because evaluation of the property normally depends on whether the object has a corresponding getter or value, either in the same object or a base object. To avoid inconsistency when two variables are specified, OwnProps ski...
by coffee
02 Feb 2024, 18:17
Forum: Ask for Help (v2)
Topic: run script as admin on startup error window
Replies: 5
Views: 330

Re: run script as admin on startup error window

If the script's path is the one in the msgbox window, could you try wrapping a_scriptfullpath in double quotes?
exploded for clarity: Run("*RunAs " . '"' . A_ScriptFullPath . '"')
by coffee
21 Jan 2024, 00:01
Forum: Ask for Help (v2)
Topic: AutoHotkey will not launch
Replies: 5
Views: 329

Re: AutoHotkey will not launch

My .ahk script won't launch because it says the system can't find it, or it doesn't give an error when I click on the file in Windows Explorer, but then it does nothing. And on the test scripts that do launch, the clipboard := "text" command won't fill the clipboard. I'm on a Windows 11 laptop. I'm...
by coffee
17 Jan 2024, 21:09
Forum: Ask for Help (v2)
Topic: Do not support this code writing method?
Replies: 3
Views: 224

Re: Do not support this code writing method?

Try changing delay%[a_index]% to delay%a_index%, if you still want to use pseudo arrays. That should at least get rid of one error.
by coffee
17 Jan 2024, 20:50
Forum: Ask for Help (v2)
Topic: Strange Global variable bug
Replies: 13
Views: 543

Re: Strange Global variable bug

 @mikeyww You're right. It may have been an inappropriate explanation. I'm sorry... I have appropriately revised the explanation. ... ... #Requires AutoHotkey v2.0 #SingleInstance Force x := 1 y() y() { MsgBox x ; Error: This variable has not been assigned a value. Specifically: local x (same name ...
by coffee
17 Jan 2024, 14:54
Forum: Ask for Help (v2)
Topic: Do not support this code writing method?
Replies: 3
Views: 224

Re: Do not support this code writing method?

a_index only works inside a loop. There's no loop statement anywhere. Besides that, delay%[a_index]% should probably be delay%a_index% , no square brackets. But autohotkey has had the technology to not need pseudo arrays since 100 years ago. So you could in theory do delay := [] as initializer, then...
by coffee
17 Jan 2024, 14:23
Forum: Ask for Help (v2)
Topic: Opening Just One Instance Of Calculator
Replies: 8
Views: 481

Re: Opening Just One Instance Of Calculator

I believe that to cover all bases you have to do something like: ; assuming titlematchmode 2 winID := WinExist("ahk_exe calc.exe") || WinExist("Calculator ahk_exe ApplicationFrameHost.exe") At some point it was just ApplicationFrameHost.exe, on my current environment it can also be detected by Calcu...
by coffee
12 Jan 2024, 19:06
Forum: Ask for Help (v2)
Topic: chars replacement
Replies: 5
Views: 225

Re: chars replacement

Map doesn't seem to support certain chars (192+) as keys... is this a bug, or something I am doing wrong? This doesn't work for me chars := Map("á", "a") gives error Missing """ chars := Map("á", "a") works on my end. The only way to get that error on my end is to have the wrong encoding on the fil...
by coffee
05 Jan 2024, 21:45
Forum: Ask for Help (v2)
Topic: High CPU USAGE ( power usage) from AHK script. This give me headache
Replies: 6
Views: 408

Re: High CPU USAGE ( power usage) from AHK script. This give me headache

if 00 sleep 5000 deleting the line with if 00 , which makes no sense, will address the cpu usage, you are not sleeping at all since that if is always false, it's eating cpu cycles down to the nanoseconds, that's why the usage is high. As for the rest, i'm pretty sure the #HotIf takes care of the wi...
by coffee
04 Jan 2024, 03:31
Forum: Ask for Help (v2)
Topic: Error when trying to read rows from a HTML table (0x800A01B6) Topic is solved
Replies: 3
Views: 215

Re: Error when trying to read rows from a HTML table (0x800A01B6) Topic is solved

quick answer until i can come back square brackets are an autohotkey abstraction provided by the __item property paired with __enum for "for" looping. com objs don't (or may not?) have this. you have to do Rows.1 and dynamically Rows.%index% loop Rows.length msgbox( Rows.%(a_index - 1)%.innerHTML )
by coffee
31 Dec 2023, 15:03
Forum: Ask for Help (v2)
Topic: Pass values to a SetTimer function? Topic is solved
Replies: 23
Views: 1586

Re: Pass values to a SetTimer function? Topic is solved

as @boiler already said, AHK v2 does not support "super-global variables" any more. But you can achieve a comparable effect if you replace them with properties of an object define in the global scope: @just me, I ran into this issue today while trying to use objects, are there any trix here or is t...
by coffee
31 Dec 2023, 14:11
Forum: Ask for Help (v2)
Topic: Odd array's capacity Topic is solved
Replies: 2
Views: 259

Re: Odd array's capacity Topic is solved

You shouldn't use the capacity property like that. You need to use "length". vehicles.length , that contains the actual count of items. Capacity is more of an internal lower abstraction type of thing, that capacity you see is the size the runtime decided to give the array at that point in initializa...
by coffee
30 Dec 2023, 17:45
Forum: Ask for Help (v2)
Topic: Capture a scripts PID when it starts, gives wrong PID Topic is solved
Replies: 11
Views: 750

Re: Capture a scripts PID when it starts, gives wrong PID Topic is solved

I haven't tested the launcher, but it sounds and looks like a prelaunch routine to switch among ahk version executables at runtime, similar to hashbang and ideas others here posted years ago. Nice to see it made into mainline, very progressive. Essentially, the OS is not running the script directly,...
by coffee
29 Dec 2023, 15:48
Forum: Ask for Help (v2)
Topic: Entire Unparsed A_Args? Topic is solved
Replies: 10
Views: 523

Re: Entire Unparsed A_Args? Topic is solved

I've tried rejoining A_Args, but many of the parser's effects cannot be precisely reversed Many of what parser effects? i did a quick skim on source and autohotkey doesn't do anything to the command line arguments, it leaves them as they are received from shell/operating system, whatever autohotkey...
by coffee
29 Dec 2023, 00:13
Forum: AutoHotkey Development
Topic: Wish buffer object could be used like object
Replies: 2
Views: 896

Re: Wish buffer object could be used like object

Are you complaining about the curly brace syntax? or can you explain more about the example and the wish? A huge point of the "extends" on native classes is that you can "extend" them to assign custom properties or functionalities as you see fit while still having access to the non-overriden native ...
by coffee
28 Dec 2023, 20:40
Forum: General Discussion
Topic: Comcast Business ISP Blocking AHK Website
Replies: 6
Views: 672

Re: Comcast Business ISP Blocking AHK Website

I've used google- and even other search engines to try and find a (solution to the) problem on my end. I am trying to avoid signing into everything once again xD, but I will try and flush/clear what I can to attempt to resolve this issue. As I mentioned, this problem has persisted for about a month...
by coffee
28 Dec 2023, 18:26
Forum: Ask for Help (v2)
Topic: Discrepancy when using Sleep in a Loop Topic is solved
Replies: 8
Views: 627

Re: Discrepancy when using Sleep in a Loop Topic is solved

Hi @Seven0528. Yes, the elapsed time is important but it only comes about if the individual sleeps are precise. The end result is precise with your script, but unfortunately the individual Sleeps are inaccurate, which is why I can't use it that way. My script above is just an example, I don't know ...
by coffee
27 Dec 2023, 14:37
Forum: Ask for Help (v2)
Topic: Discrepancy when using Sleep in a Loop Topic is solved
Replies: 8
Views: 627

Re: Discrepancy when using Sleep in a Loop Topic is solved

Hi. I'm using a Loop in a script as some sort of timer and I noticed that there is a discrepancy when using Sleep with less than 125ms. The deviation is too big to work with and gets bigger the longer the loop runs. For example, a 100 x 100ms Loop has a deviation of 937ms whereas a 400 x 100ms Loop...
by coffee
27 Dec 2023, 06:38
Forum: Ask for Help (v2)
Topic: Why does one display 1 and the other display "b"? --Menu Topic is solved
Replies: 4
Views: 800

Re: Why does one display 1 and the other display "b"? --Menu Topic is solved

If you define a function inside a class, the function definition is automatically modified to have this as its first parameter. If you define a function outside of a class, and then assign it to an object, and then call it like a method object.function(params) , the object will automatically pass it...
by coffee
27 Dec 2023, 04:43
Forum: Ask for Help (v2)
Topic: Script stopping randomly
Replies: 11
Views: 1801

Re: Script stopping randomly

Your script does not seem to incorporate or apply swagfag's suggestions. that would be implementing the "q"? you know he´s referring to v1 and i´m using v2... does not help here. Have you tried relentlessly bruteforcing the keyboard hook on a timer with #usehook and seeing if it's still stops worki...

Go to advanced search