Search found 27 matches
- 25 Aug 2023, 21:49
- Forum: Ask for Help (v2)
- Topic: v2 object issues Topic is solved
- Replies: 4
- Views: 610
Re: v2 object issues Topic is solved
Okay the workaround for map is working thanks. It's too bad I can't use the regular object notation though { k : v }, I'm going to have to rewrite a bunch of code.
- 25 Aug 2023, 20:58
- Forum: Ask for Help (v2)
- Topic: v2 object issues Topic is solved
- Replies: 4
- Views: 610
Re: v2 object issues Topic is solved
If there's no fix, can this be moved to AHK v2 bugs. This is serious. I can't use v2 until this is fixed. It's frustrating to run into an error like this after spending 20hrs learning the new system and rewriting key functions in the new syntax, only to find I can't use any of this for my primary us...
- 25 Aug 2023, 20:48
- Forum: Ask for Help (v2)
- Topic: v2 object issues Topic is solved
- Replies: 4
- Views: 610
v2 object issues Topic is solved
In my http request to access an important API, I need to send in a JSON object with header: { x-api-key : "myapikey"} I've always built the object in AHK first and then parsed it into JSON with a function. New AHKv2 decided that 'x-api-key' is an 'Invalid property name in object literal'. Come on......
- 25 Aug 2023, 19:45
- Forum: Ask for Help (v2)
- Topic: v2 Ternary Operator Fails
- Replies: 6
- Views: 557
Re: v2 Ternary Operator Fails
I know that 'ternary' has the root word of 3, but the purpose of it is shorthand and to save time, and forcing the third part of the expression defeats the core purpose of it. I also noticed numeric variables occasionally don't work. Variable named something like '3m' won't work now, although 'm3' w...
- 25 Aug 2023, 18:54
- Forum: Ask for Help (v2)
- Topic: v2 Ternary Operator Fails
- Replies: 6
- Views: 557
v2 Ternary Operator Fails
Apparently I can't do Ternary operators with only a positive result anymore... that's super annoying. Please tell me I'm missing some new syntax?
Code: Select all
a := (1 ? 2) ; throws an error
a := (1 ? 2 : 0) ; works, but is ugly because the ': 0' will never occur
- 25 Aug 2023, 18:49
- Forum: Scripts and Functions (v2)
- Topic: [Library] AHK v2 DateParse - Parse date and time formats to YYYYMMDDHH24MISS value
- Replies: 7
- Views: 2320
Re: [Library] AHK v2 DateParse - Parse date and time formats to YYYYMMDDHH24MISS value
Here's the original code updated for v2. Is it pretty? no. I'm not nearly as good a programmer as the original poster. If someone writes a better version, feel free to post it. For some reason, ternary operators in ahkv2 now seem to require the second half of the expression. Super annoying, makes th...
- 25 Aug 2023, 13:46
- Forum: Ask for Help (v2)
- Topic: Pass function as a param in v2 Topic is solved
- Replies: 1
- Views: 189
Pass function as a param in v2 Topic is solved
Okay, so this still works in v2. I thought they removed the '%' in v2. Is there a help doc I can read about how the % works in v2? I can't find it when I put '%' into the helpdoc search.
Code: Select all
cf("f1")
cf("f2")
cf(f)
{
%f%()
}
f1()
{
m("f1 called")
}
f2()
{
m("f2 called")
}
m(s)
{
MsgBox s
}
- 04 Jan 2022, 23:11
- Forum: Ask for Help (v1)
- Topic: How to copy text off page remotely Topic is solved
- Replies: 1
- Views: 238
How to copy text off page remotely Topic is solved
I would like to access the code of a webpage from my script and copy all the data to my program without loading the page in a browser. The webpage I would like to do this for is running the body of it's content in javascript. So I can't just parse html / xml (https://www.autohotkey.com/board/topic/4...
- 17 Dec 2021, 21:54
- Forum: Ask for Help (v1)
- Topic: WinHttp post request
- Replies: 7
- Views: 5778
Re: WinHttp post request
Hi there, I've modified the GetWebPage function to handle JSON well. Posting here for anyone to use. JsonData := {"contact": {"email": "johndoe@example.com","firstName": "John","lastName": "Doe","phone": "7223224241","fieldValues":[{"field":"1","value":"The Value for First Field"},{"field":"6","valu...
- 28 Nov 2021, 16:21
- Forum: Ask for Help (v1)
- Topic: Loop Files not working Topic is solved
- Replies: 9
- Views: 1580
Re: Loop Files not working Topic is solved
Wow - this is embarrassing haha. My downloads folder was filled with csv files but they all had the notepad icon and I assumed they were txt files. Everyone's code works other than my original code.
That last bit of code you posted was useful because I saw all the filenames.
Thank you
That last bit of code you posted was useful because I saw all the filenames.
Thank you
- 28 Nov 2021, 16:08
- Forum: Ask for Help (v1)
- Topic: Loop Files not working Topic is solved
- Replies: 9
- Views: 1580
Re: Loop Files not working Topic is solved
I tried everyone's suggestions above, thanks. They don't work for some reason. I think the issue is that I'm using a virtual machine. I'm not sure how to loop through files using remote desktop. I'm trying to loop through the files on the remote desktop from the remote desktop. But it seems AHK can'...
- 28 Nov 2021, 15:49
- Forum: Ask for Help (v1)
- Topic: Loop Files not working Topic is solved
- Replies: 9
- Views: 1580
Re: Loop Files not working Topic is solved
This also did the same thing as my original code. Thank you for your idea though!
- 28 Nov 2021, 15:40
- Forum: Ask for Help (v1)
- Topic: Loop Files not working Topic is solved
- Replies: 9
- Views: 1580
Loop Files not working Topic is solved
d := "C:\Users\" A_UserName "\Downloads" Loop, Files, % d msgbox % A_loopfilename For some weird reason, this program doesn't work. I've been staring at it for a while and comparing it to the help docs and I really think it should work. My downloads folder is filled with .txt files. When debugged, ...
- 12 Oct 2021, 20:36
- Forum: Ask for Help (v1)
- Topic: Can I Cloud My GUI-based AHK Script (RDP) Topic is solved
- Replies: 0
- Views: 403
Can I Cloud My GUI-based AHK Script (RDP) Topic is solved
I've got a complex long script that needs GUI. I am trying to migrate it from a physical computer to Google Cloud Compute. I am able to get the script running ok, but as soon as I minimize the Google Cloud Computer VM the script does not continue to manipulate the interface. It does continue to run,...
- 19 Aug 2021, 19:42
- Forum: Ask for Help (v1)
- Topic: Activate a window when the menubar is flashing - windows 10 Topic is solved
- Replies: 6
- Views: 542
Re: Activate a window when the menubar is flashing - windows 10 Topic is solved
You can try #WinActivateForce , plus WinActivate. I do not know whether it will help in activating your window. Outside AHK, I find various situations where windows are not activated when expected. I believe that there is also a registry entry for "steal focus" or something like that, but I never f...
- 19 Aug 2021, 18:30
- Forum: Ask for Help (v1)
- Topic: Activate a window when the menubar is flashing - windows 10 Topic is solved
- Replies: 6
- Views: 542
Re: Activate a window when the menubar is flashing - windows 10 Topic is solved
I'm not sure if this helps, but the following worked for me. Thanks for your code, it doesn't quite work for this situation. I attached a screenshot showing what's going on. As you can see the flashing menu bar is messing it up somehow. image.png OpenEdge("https://www.autohotkey.com/") SendCtrl("w"...
- 19 Aug 2021, 18:06
- Forum: Ask for Help (v1)
- Topic: Activate a window when the menubar is flashing - windows 10 Topic is solved
- Replies: 6
- Views: 542
- 19 Aug 2021, 17:49
- Forum: Ask for Help (v1)
- Topic: Activate a window when the menubar is flashing - windows 10 Topic is solved
- Replies: 6
- Views: 542
Activate a window when the menubar is flashing - windows 10 Topic is solved
Hi there, I'm trying to activate a new Microsoft Edge window which I just opened, but sometimes the Windows 10 menubar is flashing the program and that somehow stops my WinActivate from working. This program occurs consistently for me when I open a MS Edge window, close it with Ctrl W, and then open...
- 05 Aug 2021, 16:19
- Forum: Ask for Help (v1)
- Topic: Trying to make a 5 min forced break timer Topic is solved
- Replies: 2
- Views: 364
Re: Trying to make a 5 min forced break timer Topic is solved
Thanks, I did have to run as admin. Here's what I ended up with if anyone in the future is curious. (warning: it will make you unable to use your keyboard for 5 mins if you run as admin) Loop { a := 55 * 60000 Sleep, %a% Loop, 9 { SoundSet, 100 SoundBeep, 432, 600 Sleep, 600 } Sleep 300 BlockInput, ...
- 05 Aug 2021, 10:20
- Forum: Ask for Help (v1)
- Topic: Trying to make a 5 min forced break timer Topic is solved
- Replies: 2
- Views: 364
Trying to make a 5 min forced break timer Topic is solved
My goal is to write a function which turns off the screen and disables inputs for a variable period of time. I'll put this on a loop to occur for 5 mins every hour, to force me to take a break from the computer lol. :problem: The code doesn't actually disable the inputs though. Some of this code I r...