Search found 2828 matches
- 13 May 2024, 18:30
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1051
Re: String Manipulation between ^ and /
Be careful with compounded first names. What if you have a first name like Billy Jean or T.J. or Daisy-Mae. Are you sure you want to have those names as Billy or T or Daisy?
- 13 May 2024, 16:40
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1051
Re: String Manipulation between ^ and /
I don' t understand. This still works as expected:
str := '8181818^Lname/Fname ^1818181'
MsgBox LName := StrSplit(str,['^','/'])[2]
Is that not the intended result?
str := '8181818^Lname/Fname ^1818181'
MsgBox LName := StrSplit(str,['^','/'])[2]
Is that not the intended result?
- 13 May 2024, 12:36
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1051
Re: String Manipulation between ^ and /
Code: Select all
str := "blahblahblah=YYMMblahblahblah"
msgbox year := substr(str,instr(str,"=")+1,2)
msgbox month := substr(str,instr(str,"=")+3,2)
- 12 May 2024, 07:00
- Forum: Ask for Help (v2)
- Topic: works in IDE, won't work “in the field”
- Replies: 4
- Views: 235
Re: works in IDE, won't work “in the field”
I'd use:
If you have more than 2 paragraphs use Join (https://www.autohotkey.com/docs/v2/Functions.htm#Variadic)
Code: Select all
#+c::
{
a_clipboard := ""
send "^c"
if clipwait(1)
{
z := regexreplace(a_clipboard,"`n`r","`n")
arr := strsplit(z,"`n`n","`r")
MsgBox(a:=arr[1] b:=arr[2])
}
}
- 10 May 2024, 21:08
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1051
Re: String Manipulation between ^ and /
or:
Code: Select all
str := '%B1111222233334444^LastName/FirstName'
MsgBox LName := StrSplit(str,['^','/'])[2]
- 08 May 2024, 14:00
- Forum: Ask for Help (v2)
- Topic: How to tell a single click from a rapid double click Topic is solved
- Replies: 5
- Views: 377
Re: How to tell a single click from a rapid double click Topic is solved
I do not understand the question or the problem. You will determine in you script whether the Listiview has checkboxes or not. If it does have checkboxes you can use the modified Class so that a rightclick edits the cell and a doubleclick checks the box. If it does not have checkboxes you can use th...
- 07 May 2024, 18:52
- Forum: Ask for Help (v2)
- Topic: How to tell a single click from a rapid double click Topic is solved
- Replies: 5
- Views: 377
Re: How to tell a single click from a rapid double click Topic is solved
Short answer: you can't. I would do something like this. Check / uncheck using doubleclick and edit using right click. g := Gui("+AlwaysOnTop") LV := g.AddListView("w200 r12 -readonly checked", ["name","items"]) loop 12 LV.Add(, "Name " A_Index,"Item " A_Index * 10) LV.modifycol(1, 90) LV.modifycol(...
- 02 May 2024, 16:49
- Forum: Ask for Help (v1)
- Topic: save and close Excel2010
- Replies: 17
- Views: 1341
Re: save and close Excel2010
I don't know.
- 02 May 2024, 13:17
- Forum: Ask for Help (v1)
- Topic: save and close Excel2010
- Replies: 17
- Views: 1341
Re: save and close Excel2010
If you search the forum on Excel or Word, you'll see many post that include COM (googling site:autohotkey.com Excel COM shows > 15K results). Yes, we are very definitively still in Autohotkey! AHK natively includes the ability to interface with applications that include COM. I have yet to find an ex...
- 02 May 2024, 09:53
- Forum: Ask for Help (v1)
- Topic: save and close Excel2010
- Replies: 17
- Views: 1341
Re: save and close Excel2010
When dealing with Excel simulated keystrokes are unnecessary and unwanted. xl.close(1) saves and closes no need for ^s . There is also no need for any sleeps. There is also no need for WinActivate, ahk_class XLMAIN since we establish a unique link to excel. The 0x80010001 error pops up when you try ...
- 01 May 2024, 22:05
- Forum: Ask for Help (v1)
- Topic: save and close Excel2010
- Replies: 17
- Views: 1341
Re: save and close Excel2010
Try:
Code: Select all
xl := ComObjActive("excel.application")
xl.activeWorkbook.SaveCopyAs("E:\" xl.activeWorkbook.name) ; E:\ or whatever path
xl.activeWorkbook.close(1) ; close(1) saves under current path\name then closes
- 12 Apr 2024, 19:17
- Forum: Ask for Help (v2)
- Topic: Ho to get a value of ListBox1 control here?
- Replies: 6
- Views: 139
Re: How to get a value of ListBox1 control here (conitnue)?
So you want to create a hotkey (ins::) to send the option selected in the popup?. Try this: MyGui := Gui('AlwaysOnTop') MyGui.AddText(, 'Select your category') ListBox1 := MyGui.AddListBox('r6', ['Option1', 'Option2', 'Option3']) MyGui.AddButton('Default w80', 'Submit').OnEvent('Click', ButtonClicke...
- 12 Apr 2024, 16:19
- Forum: Ask for Help (v2)
- Topic: Ho to get a value of ListBox1 control here?
- Replies: 6
- Views: 139
Re: Ho to get a value of ListBox1 control here?
Home:: { global ListBox1 ; <<<<<<<<<<< MyGui := Gui('AlwaysOnTop') MyGui.AddText(, "Select category") ListBox1 := MyGui.AddListBox('r6 vCategoryChoice', ['Option1', 'Option2', 'Option3', 'Option4', 'Option5', 'Option6']) MyBtn1 := MyGui.AddButton('Default w80', 'Submit').OnEvent('Click', MyBtn1_Cli...
- 12 Apr 2024, 15:11
- Forum: Bug Reports
- Topic: COM: Table Manipulation in MS Word broken in recent AHK versions
- Replies: 10
- Views: 697
Re: COM: Table Manipulation in MS Word broken in recent AHK versions
Thank you for shedding light on the intrinsic ambiguity between properties and methods in VBA and your decision to discontinue this ambiguity in v2. That said, for those like me who made extensive use of the MS VBA documentation to write AHK COM code, it has not become easier as certain things that ...
- 08 Apr 2024, 11:32
- Forum: Ask for Help (v2)
- Topic: Please help, Data grouping, calculating total and maximum values
- Replies: 4
- Views: 166
Re: Please help, Data grouping, calculating total and maximum values
If you are a fan of more compact code: gmax := map(), gsum := map(), res := "" for x,y in strsplit(str, "`n", "`r") { z := strsplit(y," "), grp := z[1] gmax[grp] := gmax.has(grp) ? max(gmax[grp],z[2]) : z[2] gsum[grp] := gsum.has(grp) ? gsum[grp]+z[3] : z[3] } For grp in gmax res .= grp "`t" gmax[gr...
- 06 Apr 2024, 19:16
- Forum: Ask for Help (v1)
- Topic: Combining long press and double tapping scripts
- Replies: 3
- Views: 80
Re: Combining long press and double tapping scripts
My example includes one but it does not require one.
- 06 Apr 2024, 18:31
- Forum: Ask for Help (v1)
- Topic: Combining long press and double tapping scripts
- Replies: 3
- Views: 80
Re: Combining long press and double tapping scripts
Try Morse: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=127450&p=563668&hilit=morse#p563668 <^Numpad0::sendtext((x:=Morse())="0"?"single" :x="00"?"double" :x="1"?"long" :"") Morse(to := 250) { while KeyWait(hk := RegExReplace(A_ThisHotkey, ".*?(\W|\w*)$","$1"), "DT" to/1000) st := A_TickCo...
- 06 Apr 2024, 15:02
- Forum: Pedir Ayuda
- Topic: Tomar coordenadas de window y no de screen Topic is solved
- Replies: 1
- Views: 143
- 06 Apr 2024, 12:45
- Forum: Ask for Help (v2)
- Topic: ComObjActive with several open Word files Topic is solved
- Replies: 4
- Views: 206
Re: ComObjActive with several open Word files Topic is solved
ComObjActive does not connect to a file, it connects to the application (in this case MS Word). Having several files open in Word does not mean that there are several instances of the application running simultaneously. Several files can be open and running under the same instance . One of the open ...
- 05 Apr 2024, 13:25
- Forum: Ask for Help (v1)
- Topic: Reading CSV, but maintaining linebreaks and carriage returns between double quotes Topic is solved
- Replies: 12
- Views: 621
Re: Reading CSV, but maintaining linebreaks and carriage returns between double quotes Topic is solved
Thanks, just me . It is a similar issue. As long as you do not have any `r`n (i.e. CRLF = a carriage return and a linefeed together ) inside double quoted text*, you can strsplit(xxx,"`r`n) and use the CSV parsing loop to achieve your 2 objectives: 1) a multi-line cell shown as a one-liner inside a ...