List Hot String Array Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NoobyGuy
Posts: 1
Joined: 11 Apr 2021, 00:28

List Hot String Array

11 Apr 2021, 00:50

Hello everyone, I am pretty new to this forum and autohotkey. I had some experience using it for work purposes in the past, but I barely got into the programming of the scripts themselves.

Right now I am trying to create a script that can list items in an array one by one using a loop. The idea is to use this to fill job applications so here is my logic. I create an array of strings containing my experiences from a previous job of mine. Then by assigning a hotkey to a specific job position, I can just list the experiences pertaining to them and this way I do not have to check if the export option carried the text from my resume onto the job app correctly every time.

Below is my dummy code to first get things working. The problems I am facing are the following:
1. The strings are actually shown within the same line, rather than one and then the other below per iteration.

So my result is:
HelloWorld

When I really want it to be:
Hello
World

2. I am not sure if this idea is actually possible in autohotkey, do you friends know if there is a limit of characters one can have on a string in an array?

Code: Select all

^q::
Array := ["Hello", "World"]
Loop , 2
Send % Array[A_Index]
Send {ENTER}
return
Thanks in advance! If you all have suggestions to fix my issue, I would really appreciate them. Thanks!
teadrinker
Posts: 4326
Joined: 29 Mar 2015, 09:41
Contact:

Re: List Hot String Array  Topic is solved

11 Apr 2021, 05:38

NoobyGuy wrote: The strings are actually shown within the same line
Use braces like this:

Code: Select all

^q::
Array := ["Hello", "World"]
Loop 2 {
   SendInput % Array[A_Index]
   Send {Enter}
}
Return
Or send everything in one line:

Code: Select all

^q::
Array := ["Hello", "World"]
Loop 2
   SendInput % Array[A_Index] . "{Enter}"
Return
Better:

Code: Select all

^q::
Array := ["Hello", "World"]
for k, v in Array {
   SendInput {Text}%v%
   Send {Enter}
}
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], RandomBoy, Rohwedder and 406 guests