Search found 302 matches

by Datapoint
Yesterday, 22:43
Forum: Ask for Help (v1)
Topic: How to program a "hard space"
Replies: 5
Views: 312

Re: How to program a "hard space"

Instead of the keyboard shortcut, maybe send the character itself. No-Break Space is U+00A0. So maybe:

Code: Select all

:B0C*:Mr. ::
Send % "{Backspace 1}" Chr(0x00A0)
return
by Datapoint
18 May 2024, 16:34
Forum: Ask for Help (v2)
Topic: COM change Language ID in Word
Replies: 8
Views: 516

Re: COM change Language ID in Word

This is the code shown in your image and ported to AHK. The language ID's are listed at the link in the comments. oWord := ComObjActive("Word.Application") wdRussian := 1049 ; https://learn.microsoft.com/en-us/office/vba/api/Word.wdlanguageid oWord.Selection.WholeStory oWord.Selection.LanguageID := ...
by Datapoint
09 May 2024, 17:07
Forum: Ask for Help (v1)
Topic: for loop ending early
Replies: 3
Views: 361

Re: for loop ending early

It's probably because as you are looping through an object you are also removing items from the object. When an item is removed from the object the remaining item indexes get shifted by one. One solution is to loop though the array in reverse order. Compare the following for-loop to the while-loop: ...
by Datapoint
09 May 2024, 13:47
Forum: Ask for Help (v2)
Topic: Only a number (RegExMatch?)
Replies: 9
Views: 391

Re: Only a number (RegExMatch?)

Convert to string in case it is a pure number: IsDigit(String(x))

You would also need to check if it's blank, as has been pointed out.
by Datapoint
09 May 2024, 10:32
Forum: Ask for Help (v2)
Topic: Only a number (RegExMatch?)
Replies: 9
Views: 391

Re: Only a number (RegExMatch?)

There's also a built in function: https://www.autohotkey.com/docs/v2/lib/Is.htm#digit

MsgBox IsDigit('123')
by Datapoint
03 May 2024, 00:34
Forum: Ask for Help (v2)
Topic: Is it Possible to Monitor Outlook Desktop for New Emails ?
Replies: 2
Views: 312

Re: Is it Possible to Monitor Outlook Desktop for New Emails ?

You could connect to the Outlook Event that is fired when an email is received. Here is a function/example I wrote that could be adapted: v1 example It's v1 code, but it would be almost identical in v2. Look for the heading that says "Outlook Events". You will need to un-comment the function NewMail...
by Datapoint
19 Apr 2024, 15:02
Forum: Ask for Help (v1)
Topic: Find second punctuation mark in the middle of the line
Replies: 1
Views: 103

Re: Find second punctuation mark in the middle of the line

One of these maybe: str := "This is a simple sentence!`nThis is a second sentence in line two.`nThis is also a sentence. You should find this line of text!`nLine_Next.`nLine_Next." ;RegExMatch - find the second sentence on one line RegExMatch(str, "[!.?]\h\K[^\v]+", match) MsgBox % match ;RegExMatch...
by Datapoint
17 Apr 2024, 16:43
Forum: Ask for Help (v2)
Topic: Help converting v1 script regarding Excel to v2
Replies: 2
Views: 118

Re: Help converting v1 script regarding Excel to v2

Here you go:

Code: Select all

^e::Run "Excel"

#x:: {
	xx := FormatTime("yyyMMdd")
	Send xx
}
by Datapoint
06 Mar 2024, 00:21
Forum: Ask for Help (v1)
Topic: Getting RegExMatch syntax right
Replies: 2
Views: 104

Re: Getting RegExMatch syntax right

For some reason I don't seem to be able to use standard.MaxIndex() Try the for-loop or loop like here. I would usually use a for-loop for an array. Both work. standard := ["case", "b", "c"] for myKey, myVal in standard { MsgBox % myKey "`n" myVal } ; Or use a % to force an expression. https://www.a...
by Datapoint
06 Mar 2024, 00:01
Forum: Off-topic Discussion
Topic: Flat Earth vs. Globe Earth
Replies: 115
Views: 64306

Re: Flat Earth vs. Globe Earth

I don't disagree. Falsehoods are also not eradicated by continually discussing them as an alternative to the truth. I was playing the devil's advocate because there is nuance. This thread is basically a lot of very good arguments in favor of science. If we are arguing against an insignificant minori...
by Datapoint
05 Mar 2024, 20:19
Forum: Off-topic Discussion
Topic: Flat Earth vs. Globe Earth
Replies: 115
Views: 64306

Re: Flat Earth vs. Globe Earth

I can empathize with Ernestheili 's point, so I'll play the devil's advocate for a bit. This thread "feeds the trolls" by simply mentioning the idea. No matter how you attempt to disprove it, giving more attention to the "debate" lends it more credibility and further propagates it. Debating a flat e...
by Datapoint
12 Feb 2024, 03:59
Forum: Ask for Help (v1)
Topic: Excel COM add sheet after the last sheet Topic is solved
Replies: 4
Views: 180

Re: Excel COM add sheet after the last sheet Topic is solved

Glad to hear it's working for you. It happends quite often to me that I find the solution in VBA code and then I don't know to how to convert it in "COM/AHK" code. Does exist some tutorial to operate this conversion? There are lots of examples on the forum that can be found with google or the like. ...
by Datapoint
11 Feb 2024, 19:20
Forum: Ask for Help (v1)
Topic: Excel COM add sheet after the last sheet Topic is solved
Replies: 4
Views: 180

Re: Excel COM add sheet after the last sheet Topic is solved

Code: Select all

F12::ExcelAddSheetLast()

ExcelAddSheetLast() {
	xlSheets := ComObjActive("Excel.Application").ActiveWorkbook.Sheets
	xlSheets.Add(, xlSheets.Item(xlSheets.Count))
}
by Datapoint
06 Feb 2024, 22:39
Forum: Off-topic Discussion
Topic: Rosetta Code for v2
Replies: 5
Views: 926

Re: Rosetta Code for v2

the Rosetta wiki page for Programming Languages lists one for AutoHotkey and two for AutoHotkey v2 That's unfortunate. v2 should not be listed there. Rosetta Code has pages for implementations , and pages for languages . All versions of AHK are part of the same language . Different versions should ...
by Datapoint
06 Feb 2024, 14:58
Forum: Ask for Help (v1)
Topic: Are AHK COM functions not available in Outlook anymore?
Replies: 7
Views: 588

Re: Are AHK COM functions not available in Outlook anymore?

It sounds like you are having the same issue as burque505 mentioned in this thread . The underlying cause of the issue was not found in the other thread. You came to the same solution of using AccessibleObjectFromWindow as a workaround. Why it works is beyond my coding knowledge. They use different ...
by Datapoint
06 Feb 2024, 00:29
Forum: Ask for Help (v1)
Topic: Are AHK COM functions not available in Outlook anymore?
Replies: 7
Views: 588

Re: Are AHK COM functions not available in Outlook anymore?

My first guess is that Outlook is running as admin. If Outlook is running as admin then the script would need to be admin also. It's better if both are not running as admin. ComObjActive needs Outlook to be running. If it's not running then use ComObjCreate instead. If you just launched Outlook, yo...
by Datapoint
05 Feb 2024, 02:24
Forum: Off-topic Discussion
Topic: Rosetta Code for v2
Replies: 5
Views: 926

Re: Rosetta Code for v2

I have not seen any posts there for v2 yet. The AutoHotkey 1.1 page still says that it's the current version. It hasn't been updated. Posts should be using the Works with template to identify the version. For example, link . Unfortunately, this only happens the minority of the time. Even with v1.1 v...
by Datapoint
05 Feb 2024, 02:13
Forum: Ask for Help (v1)
Topic: Are AHK COM functions not available in Outlook anymore?
Replies: 7
Views: 588

Re: Are AHK COM functions not available in Outlook anymore?

COM won't work in the new Outlook. Good news is that, from what I can tell, new Outlook will not replace Outlook. It's similar to other email programs in the past and present; like if you remember Outlook Express. This is a quote from the best summary I've seen: [New Outlook] is not a successor, but...
by Datapoint
31 Jan 2024, 15:45
Forum: Ask for Help (v2)
Topic: working with attachments in outlook
Replies: 10
Views: 720

Re: working with attachments in outlook

Realized since I am removing attachments I need to loop through them backwards to not mess up the index. I just realized I made the exact same mistake, even after I had read FanaticGuru's post. I corrected my script above. Specifically, this part: ; Remove files that are not PDF from the new mail i...
by Datapoint
31 Jan 2024, 12:27
Forum: Ask for Help (v1)
Topic: Excel COM - changing spreadsheet names & tab colors Topic is solved
Replies: 2
Views: 212

Re: Excel COM - changing spreadsheet names & tab colors Topic is solved

Here's one way to do it by looping through the sheets. You don't need the arrays though, I just used them to organize it a bit. You could replace the array with if-statements or switch. if (sht.Name = x) ... ... tabs := { 123: ["The General Building", 0xFF901E] , 456: ["Another Building", 0x00FFFF] ...

Go to advanced search