I prefer fileRead, OutputVar, Filename just read the whole file as one long string. Skip the Text := middleman
https://www.autohotkey.com/docs/v1/lib/FileRead.htm
Search found 1429 matches
- Yesterday, 22:48
- Forum: Ask for Help (v1)
- Topic: Cannot pickup data from a file
- Replies: 2
- Views: 154
- 02 May 2024, 20:22
- Forum: Scripts and Functions (v1)
- Topic: [Class] expect.ahk (rapid unit testing)
- Replies: 23
- Views: 3734
Re: [Class] expect.ahk (rapid unit testing)
That's fantastic, well done :thumbup: Would be great to post in the v2 scripts and functions A short blurb like "Inspired in part by expect.ahk (v1)" would be appreciated but not required. If you would like a more visual link this could be cool: https://img.shields.io/badge/inspired_by-expect.ahk-g...
- 02 May 2024, 12:15
- Forum: Ask for Help (v1)
- Topic: Need help with a project
- Replies: 4
- Views: 282
- 01 May 2024, 07:51
- Forum: Ask for Help (v1)
- Topic: Call a function whose name is stored in an associative array
- Replies: 4
- Views: 358
Re: Call a function whose name is stored in an associative array
autohotkey has these things called function objects, you can also put those in an array and call them like so: funcObj := func("myCoolFunc") myArray := {"func1": funcObj, "func2": funcObj, "func3": funcObj} myArray["func2"].call(10) ; => 20 myCoolFunc(parameter) { msgbox, % parameter * 2 } You may f...
- 30 Apr 2024, 09:44
- Forum: Ask for Help (v1)
- Topic: Get longest line's character count in multiline string Topic is solved
- Replies: 5
- Views: 526
Re: Get longest line's character count in multiline string Topic is solved
Hopefully this is obvious but if you just want the character count you can fit it in one line simply enough: myMultiLineStr := "hello`nworld`nfoobar" msgbox, % A.size(A.maxBy(strSplit(myMultiLineStr, "`n"), A.size)) ; => 6 https://biga-ahk.github.io/biga.ahk/#/?id=map https://biga-ahk.github.io/biga...
- 30 Apr 2024, 09:36
- Forum: Ask for Help (v1)
- Topic: Get longest line's character count in multiline string Topic is solved
- Replies: 5
- Views: 526
Re: Get longest line's character count in multiline string Topic is solved
Just for fun:
I find this very readable and portable
Code: Select all
A := new biga() ; requires https://github.com/biga-ahk/biga.ahk
longestString := A.maxBy(["string1", "string12", "string123"], A.size)
msgbox, % longestString
; => "string123"
msgbox, % A.size(longestString)
; => 9
- 28 Apr 2024, 23:05
- Forum: Ask for Help (v1)
- Topic: POST to unsigned HTTPS
- Replies: 1
- Views: 278
Re: POST to unsigned HTTPS
Your title says POST but the code posted is sending "GET"
- 23 Apr 2024, 07:37
- Forum: Ask for Help (v1)
- Topic: Translation hotkey
- Replies: 6
- Views: 209
Re: Translation hotkey
I like the DeepL API. it is free if you keep your translations under {{x}} per month.
Here is a simple one I saw once for looking up singular words on Jisho.org
Here is a simple one I saw once for looking up singular words on Jisho.org
Code: Select all
!j::
run, %comspec% /c start https://jisho.org/search/%clipboard%
return
- 22 Apr 2024, 15:41
- Forum: Ask for Help (v1)
- Topic: Easy licensing script
- Replies: 3
- Views: 133
Re: Easy licensing script
I'm also interested in this
- 19 Apr 2024, 13:33
- Forum: Ask for Help (v1)
- Topic: How to make this script automatically activate in every 20 second? Topic is solved
- Replies: 5
- Views: 262
- 18 Apr 2024, 15:20
- Forum: Ask for Help (v1)
- Topic: V1: Reload script when Dropbox finishes syncing
- Replies: 4
- Views: 150
Re: V1: Reload script when Dropbox finishes syncing
One other idea is you can reload when a change is detected and static for over {{x}} seconds. It sounds like there may be more than one file involved in the sync. If not you can just reload after any file change is detected.
- 16 Apr 2024, 11:00
- Forum: Ask for Help (v1)
- Topic: Trim sentences
- Replies: 2
- Views: 46
Re: Trim sentences
Just for fun: A := new biga() ; requires https://github.com/biga-ahk/biga.ahk str := " This is the first sentence. `n This is the second. `n Here comes the the third sentence. " str2 := A.join(A.map(strSplit(str, "`n"), A.trim), "`n") ; => "This is the first sentence.`nThis is the second.`nHere come...
- 13 Apr 2024, 12:21
- Forum: Gaming Help (v1)
- Topic: click on image text
- Replies: 11
- Views: 417
Re: click on image text
For games you can post here: viewforum.php?f=18
- 13 Apr 2024, 12:19
- Forum: Scripts and Functions (v1)
- Topic: [Class] expect.ahk (rapid unit testing)
- Replies: 23
- Views: 3734
Re: [Class] expect.ahk (rapid unit testing)
v1 has if var contains as standard syntax, but this has been removed in v2 - which is a shame imho. Huh did not know that was removed in v2. Obviously since it is not a function in v1 it does not fit comfortably in one line expect.true(UserInput not in yes,no) or whatever it would be. My current pl...
- 12 Apr 2024, 15:46
- Forum: Ask for Help (v1)
- Topic: Is it possible to output several voices in one audio file?
- Replies: 2
- Views: 73
Re: Is it possible to output several voices in one audio file?
Sorry I misunderstood the question as speaking two voices at the same time. I don't know anything about file output.
- 11 Apr 2024, 22:14
- Forum: Scripts and Functions (v1)
- Topic: [Class] expect.ahk (rapid unit testing)
- Replies: 23
- Views: 3734
Re: [Class] expect.ahk (rapid unit testing)
Yes inStr returns the location. v1 does not have a built-in 'contains' function or that would be better. I believe most examples have been switched to a perhaps clearer expect.true((1 == 1))
Additionally ahk cannot differentiate true from 1
Additionally ahk cannot differentiate true from 1
- 10 Apr 2024, 11:36
- Forum: Scripts and Functions (v1)
- Topic: [Class] expect.ahk (rapid unit testing)
- Replies: 23
- Views: 3734
Re: [Class] expect.ahk (rapid unit testing)
I for sure see an issue with .writeResultsToFile and that's my fault as I don't use that feature much yet. Fix should be on github hopefully today along with some tests as there are currently NONE for that method
- 06 Apr 2024, 18:58
- Forum: Ask for Help (v1)
- Topic: Find color closest to cursor and click Topic is solved
- Replies: 24
- Views: 657
Re: Find color closest to cursor and click Topic is solved
Now I am satisfied
- 05 Apr 2024, 10:05
- Forum: Ask for Help (v1)
- Topic: Find color closest to cursor and click Topic is solved
- Replies: 24
- Views: 657
Re: Find color closest to cursor and click Topic is solved
You didn't use any arrays
What if user wanted to find a purple pixel or a green one? Not just variations
What if user wanted to find a purple pixel or a green one? Not just variations
- 03 Apr 2024, 15:09
- Forum: Ask for Help (v1)
- Topic: Find color closest to cursor and click Topic is solved
- Replies: 24
- Views: 657
Re: Find color closest to cursor and click Topic is solved
this is my first time hearing about matching three possible different colors.
I would use an array
ForEach() {
if match { sortClosest => click location }
}
You get the general idea
I would use an array
ForEach() {
if match { sortClosest => click location }
}
You get the general idea