Search found 520 matches
- 28 Nov 2022, 11:08
- Forum: Ask for Help (v1)
- Topic: Merging arrays question
- Replies: 15
- Views: 1062
Merging arrays question
I'm having trouble conceptualizing the method to accomplish this. I have two arrays, one with values only and one with arrays of values. I need to merge these into the array of values only in their intended sequential order. So for example: Arr1 := [1,4,7] Arr2 := [[2,3],[5,6],[8,9,10]] Arr1 should ...
- 02 Jun 2022, 13:37
- Forum: Ask for Help (v1)
- Topic: Changing specific words in a given script
- Replies: 2
- Views: 283
Re: Changing specific words in a given script
Probably the most simple way around it would be this:
Code: Select all
::emailsubject::
InputBox, out, Enter Text, Enter the deisred text for your hotstring., , , , , , , 10
if (ErrorLevel>0)
return
Send Project [%out%] // Comments
return
- 08 Jan 2020, 09:03
- Forum: Ask for Help (v1)
- Topic: Excel search for "text" and the formula Topic is solved
- Replies: 4
- Views: 964
Re: Excel search for "text" and the formula Topic is solved
Just to further clarify on TLM's solution, if you don't specify where you want to look in the LookIn parameter of Find() , Excel will check everything; if a cell in the range has a formula, it's going to search the text of the formula and the result of the formula (the value). If you want it to sear...
- 23 Sep 2019, 08:48
- Forum: Ask for Help (v1)
- Topic: Pasting strings does not always work
- Replies: 16
- Views: 3197
Re: Pasting strings does not always work
Ideally you'd like to run a loop to check that the variables are changing at each step, but that (for me) just makes the script more burdensome to manage than just seeding each step with an arbitrary sleep time. At worst your hotkey will take a little over a second to execute, and if it works you ca...
- 19 Sep 2019, 09:49
- Forum: Ask for Help (v1)
- Topic: Convert cell names in spreadsheets to numbers Topic is solved
- Replies: 17
- Views: 3020
Re: Convert cell names in spreadsheets to numbers Topic is solved
Since modern spreadsheets breech three alpha chars for the columns, a slight modification to boiler's code: Loop { InputBox, CellName, Cell Name, Input cell name:`n(Cancel to exit),, 180, 150 if ErrorLevel ExitApp RegExMatch(CellName, "([A-Z]+)(\d+)", Part), RowNum := Part2 - 1 if (StrLen(Part1) = 3...
- 09 Sep 2019, 08:24
- Forum: Ask for Help (v1)
- Topic: Loop toggle not working
- Replies: 13
- Views: 7138
Re: Loop toggle not working
I can't watch the video at the moment, but if you need to break operation immediately then 2::Reload is probably your best bet. But time is going to be going by fast in your script, so at least some keystrokes beyond what you need are going to get buffered and executed despite your reload. It will p...
- 04 Sep 2019, 07:53
- Forum: Ask for Help (v1)
- Topic: Loop toggle not working
- Replies: 13
- Views: 7138
Re: Loop toggle not working
Are you looking for the code to stop when the current iteration of the loop finishes, or break operation immediately?
- 24 Jul 2019, 07:57
- Forum: Ask for Help (v1)
- Topic: Problem with RegExMatch Topic is solved
- Replies: 6
- Views: 1442
Re: Problem with RegExMatch Topic is solved
Also, .Count returns the overall number of subpatterns in your regex, so it's returning what's expected based on your regexes. If you want to see the match, you should use .Value.
- 24 Jul 2019, 07:50
- Forum: Ask for Help (v1)
- Topic: Problem with RegExMatch Topic is solved
- Replies: 6
- Views: 1442
Re: Problem with RegExMatch Topic is solved
regex101 uses an implementation of regex with a global flag, which tells the engine to keep matching until no more matches can be found. AHK does not.
- 25 Jun 2019, 13:36
- Forum: Ask for Help (v1)
- Topic: Basic Excel Com Obj script Topic is solved
- Replies: 16
- Views: 7875
Re: Basic Excel Com Obj script Topic is solved
Code: Select all
::#cam1::
xl := ComObjGet("C:\Users\Enrique\Desktop\Codes\Excel COM\TEST - 00000 - Comobject Test Sheet.xlsx")
Send, % x1.Range("B3").value
Send, % xl.Range("B11").Value
return
- 20 Jun 2019, 10:56
- Forum: Ask for Help (v1)
- Topic: Variable Excel Sheet Name Error
- Replies: 2
- Views: 875
Re: Variable Excel Sheet Name Error
Code: Select all
vSheetName := SheetName ; <~~ no percent signs around 'SheetName'
- 20 Jun 2019, 10:54
- Forum: Ask for Help (v1)
- Topic: Newbie Help with Hotstring
- Replies: 4
- Views: 1011
Re: Newbie Help with Hotstring
Try this instead:
Beyond that, you're going to have to experiment with the Send modes and key delays, because the receiving program is causing the problem.
Code: Select all
:*t0:<c*::
(
<comment author="abcd">
</comment>
)
Sleep, 25
Send {HOME}{UP 2}
return
- 20 Jun 2019, 10:09
- Forum: Ask for Help (v1)
- Topic: Newbie Help with Hotstring
- Replies: 4
- Views: 1011
Re: Newbie Help with Hotstring
I think eliminating the automatic backspacing is unnecessary, just adds complexity to what you're trying to do.
This works fine for me.
This works fine for me.
Code: Select all
:*t0:<c*::<comment author="abcd">{ENTER 2}</comment>{ENTER}{HOME}{UP 2}
- 20 Jun 2019, 07:45
- Forum: Ask for Help (v1)
- Topic: ö or ø in auto-replace
- Replies: 1
- Views: 583
Re: ö or ø in auto-replace
Are you using a Unicode version of Autohotkey?
- 18 Jun 2019, 14:16
- Forum: Ask for Help (v1)
- Topic: RegEx lookbehind assertion question Topic is solved
- Replies: 2
- Views: 1208
Re: RegEx lookbehind assertion question Topic is solved
Look-ahead and look-behind assertions wrote: Look-behinds are more limited than look-aheads because they do not support quantifiers of varying size such as *, ?, and +.
- 18 Jun 2019, 12:22
- Forum: Ask for Help (v1)
- Topic: Name Permutation.
- Replies: 23
- Views: 4442
Re: Name Permutation.
Code: Select all
var=John Smith David James
Loop % (n := StrSplit(var," ")).MaxIndex()
{
For i, p in n
out .= p " "
out := SubStr(out,1,StrLen(out)-1) "`n", n.Push(n.RemoveAt(1))
}
MsgBox % out
- 30 May 2019, 15:34
- Forum: Ask for Help (v1)
- Topic: Convert AHK script into VBA and run from Excel
- Replies: 1
- Views: 1037
Re: Convert AHK script into VBA and run from Excel
AHK is part of RPA, but is likely frowned upon by employers Most of the long-timers here have worked with AHK at some of the biggest companies in the world, so long as you have a good business justification prepared in case they want one you should have almost no problem installing AHK on a work co...
- 29 May 2019, 08:24
- Forum: Ask for Help (v1)
- Topic: Unprotect Excel worksheet
- Replies: 3
- Views: 1278
Re: Unprotect Excel worksheet
If you are unprotecting a sheet that does not have a password:
Code: Select all
xl := ComObjActive("Excel.Application")
, xl.ActiveSheet.Unprotect
- 28 May 2019, 15:54
- Forum: Ask for Help (v1)
- Topic: RegExMatch help
- Replies: 14
- Views: 3120
Re: RegExMatch help
Is there a reason that you can't use this?
Code: Select all
var=<hold>17,293 Plans</hold>
RegExMatch(var,"[\d`,]+",m)
MsgBox % m
- 28 May 2019, 12:37
- Forum: Ask for Help (v1)
- Topic: Divide String by number of characters Topic is solved
- Replies: 11
- Views: 3211
Re: Divide String by number of characters Topic is solved
Another way to do it, just as an interesting exercise:
Code: Select all
var=FFD8FFE000104A46494600010101006000600000FFDB0043000201010201010202020202020202030503
Loop % (StrLen(var) // 10)
out .= SubStr(var,((A_Index-1)*10)+1,10) "`n"
out .= SubStr(var,-(Mod(StrLen(var),10))+1)
MsgBox % out