Search found 2832 matches
- 19 May 2024, 20:08
- Forum: Bug Reports
- Topic: loop parse "CSV" doesn't work for some CSV
- Replies: 9
- Views: 486
Re: loop parse "CSV" doesn't work for some CSV
I do not believe that var := '"abc,def" ghi,jkl' is a proper CSV. Whether like this or with linefeeds in between. It is not properly parsed and ghi is ignored (run the code above). If double quotes are used they should be around the entire field ("enclosing the field"). RFC-4180 says "If double-quot...
- 19 May 2024, 16:09
- Forum: Bug Reports
- Topic: loop parse "CSV" doesn't work for some CSV
- Replies: 9
- Views: 486
Re: loop parse "CSV" doesn't work for some CSV
I doubt the Python CSV library plays nicely with malformed CSV files...
- 19 May 2024, 15:12
- Forum: J'ai besoin d'aide
- Topic: centrer une fenêtre d'un fichier .bat au centre d'un écran sans connaitre la taille de l'écran ?
- Replies: 14
- Views: 1133
Re: centrer une fenêtre d'un fichier .bat au centre d'un écran sans connaitre la taille de l'écran ?
Centrer une fenetre, CMD ou autre: f12:: Run, %comspec% /k dir *.* Winwaitactive ahk_exe WindowsTerminal.exe WinGetPos, , , w, h, ahk_exe WindowsTerminal.exe WinMove, ahk_exe WindowsTerminal.exe,, % (A_ScreenWidth - w) // 2, % (A_ScreenHeight - h) // 2 Integrer ce code dans le fichier .bat? Le conce...
- 19 May 2024, 13:47
- Forum: Bug Reports
- Topic: loop parse "CSV" doesn't work for some CSV
- Replies: 9
- Views: 486
Re: loop parse "CSV" doesn't work for some CSV
Don't expect loop parse "CSV" to work on a malformed CSV file.
This is not going to work:
The double quotes have to be around the entire field.
This is not going to work:
Code: Select all
var := '"abc,def" ghi,jkl'
Loop parse, var, "CSV"
msgbox a_loopfield
- 13 May 2024, 18:30
- Forum: Ask for Help (v2)
- Topic: String Manipulation between ^ and /
- Replies: 22
- Views: 1211
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: 1211
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: 1211
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: 267
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: 1211
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: 420
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: 420
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: 1428
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: 1428
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: 1428
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: 1428
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: 143
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: 143
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: 740
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: 168
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: 81
Re: Combining long press and double tapping scripts
My example includes one but it does not require one.