Search found 23 matches

by Xerxes77
17 Dec 2015, 03:12
Forum: Ask For Help
Topic: Code request, Pluralize/Singularize a word before text cursor.
Replies: 2
Views: 835

Re: Code request, Pluralize/Singularize a word before text cursor.

I don't think it's feasible. There are too many exceptions in the English language to make this work: E.g. Singular Plural Mouse Mice House Houses Only difference between those two words is the first letter but the plural is completely different. You can program an exception for mouse but how many o...
by Xerxes77
13 Dec 2015, 01:47
Forum: Ask For Help
Topic: Extracting names between parentheses and commas and assigning each a hotstring
Replies: 3
Views: 893

Re: Extracting names between parentheses and commas and assigning each a hotstring

No problem. There are various different ways to get rid of the spaces. I tend to use regex: MyText := " SomeText " Filtered := regexreplace(MyText, "^\s+") ;trim beginning whitespace FilteredAgain := regexreplace(Filtered, "\s+$") ;trim ending whitespace
by Xerxes77
12 Dec 2015, 20:51
Forum: Ask For Help
Topic: Extracting names between parentheses and commas and assigning each a hotstring
Replies: 3
Views: 893

Re: Extracting names between parentheses and commas

if you've now got a list separated by commas, you can then extract each element using example #1 from Loop (parse a string):

https://www.autohotkey.com/docs/commands/LoopParse.htm
by Xerxes77
09 Dec 2015, 04:09
Forum: Ask For Help
Topic: [SOLVED] repetitive codes help Topic is solved
Replies: 9
Views: 1823

Re: repetitive codes help Topic is solved

I generally try and avoid using labels, as long scripts can be difficult to debug if there are lots of labels in there. I prefer to do something like this: Condition1 := 0 Condition2 := 0 if (a == X) { Condition1 := 1 } else { Condition2 := 1 } if (b == Y) { Condition1 := 1 } else { Condition2 := 1 ...
by Xerxes77
08 Dec 2015, 22:15
Forum: Ask For Help
Topic: WinClose and Click not working on a specific window
Replies: 6
Views: 1513

Re: WinClose and Click not working on a specific window

Hmm, it should work.

So is the script definitely reaching the WinClose line?

Code: Select all

Loop {
	IfWinExist, Sound
	{
		MsgBox, WinClose should activate here
		WinClose, Sound
		Sleep, 10
		IfWinExist, Sound
		{
			continue
		}
		break
	}
	Sleep 1
	if (A_Index > 10000) {
		break
	}
}
return
by Xerxes77
06 Dec 2015, 01:12
Forum: Ask For Help
Topic: Trigger some function in some other program using its dllfile function
Replies: 2
Views: 828

Re: Trigger some function in some other program using its dllfile function

I'm also interested in this. I wrote a script which used PostMessage several times to interact with a third party program, but it was a bit difficult to make it reliable enough. Main reason being that because the PostMessages would trigger to download info from the net, so I would have to tell the s...
by Xerxes77
02 Dec 2015, 22:37
Forum: Ask For Help
Topic: A return must be encountered prior to this } error
Replies: 8
Views: 2839

Re: A return must be encountered prior to this } error

Ahhh thanks timelizard :) now I see why everyone was confused about what the outer loop was for... I didn't realise that ButtonOK: and GuiClose: were separate subroutines. I guess this is what happens when you blindly follow the examples without questioning every line of code in them... Here is my e...
by Xerxes77
02 Dec 2015, 03:27
Forum: Ask For Help
Topic: A return must be encountered prior to this } error
Replies: 8
Views: 2839

Re: A return must be encountered prior to this } error

Thanks Lexikos. I think I have a better idea of what's happening. But based on what you said, it seems I may have to adjust the code a fair bit to get it working the way I want it to. I was playing around with what I had and I can see how it runs now: FinishedEdit := "N" While (FinishedEdit == "N") ...
by Xerxes77
01 Dec 2015, 02:36
Forum: Ask For Help
Topic: A return must be encountered prior to this } error
Replies: 8
Views: 2839

Re: A return must be encountered prior to this } error

Ah, I'm a little confused. So my understanding is that for GUIs in general, the 'return' is to indicate the end of the autoexecute section. Based on what you're saying, I can't/shouldn't use a GUI inside a loop as every time the user clicks on the control it launches another subroutine? The reason f...
by Xerxes77
30 Nov 2015, 21:26
Forum: Ask For Help
Topic: A return must be encountered prior to this } error
Replies: 8
Views: 2839

A return must be encountered prior to this } error

Hi guys, I've been working on a simple excel script, but I seem to be encountering this error. The following code works fine: oExcel := ComObjActive("Excel.Application") ;Connects to the active Excel application FinishedEdit := "N" ;While (FinishedEdit == "N") ;{ ;Destroy Previous run of the Gui Gui...
by Xerxes77
20 Nov 2015, 18:15
Forum: Ask For Help
Topic: Excel Type mismatch error
Replies: 3
Views: 1540

Re: Excel Type mismatch error

Thanks Kon. I just realised I was using a different excel file when I was testing it last week.

I skipped over the fact that MaxIndex() returns an empty string (rather than 0) when the array is empty.

Cheers
by Xerxes77
20 Nov 2015, 17:19
Forum: Ask For Help
Topic: Excel Type mismatch error
Replies: 3
Views: 1540

Excel Type mismatch error

Hi guys, I've got an a script which uses Excel and I'm having a bit of trouble trying to work out why I'm getting this error message: Error: 0x8002005 - Type mismatch Specifically: Cells It points to a line in my script which reads: oExcelTC.Cells(ExtendedTableLengthF2 + 1 + A_Index, 1).Value := "# ...
by Xerxes77
14 Mar 2015, 23:20
Forum: Ask For Help
Topic: URLDownloadToFile Timeout
Replies: 5
Views: 2070

Re: URLDownloadToFile Timeout

Thanks garry - my bad for not reading through the examples in the help file properly.. :facepalm: Yeah, it looks like the second example using COM also does what I wanted given that there is no timeout altogether and waits for the response from the server: ; Example: Download text to a variable: whr...
by Xerxes77
14 Mar 2015, 01:03
Forum: Ask For Help
Topic: URLDownloadToFile Timeout
Replies: 5
Views: 2070

Re: URLDownloadToFile Timeout

Awesome - thanks for that Lexikos. I'll need to look at it more closely to apply it to my script, but on initial testing it seems it fixes the problem I was having.

Thanks :thumbup:
by Xerxes77
13 Mar 2015, 21:02
Forum: Ask For Help
Topic: URLDownloadToFile Timeout
Replies: 5
Views: 2070

URLDownloadToFile Timeout

Hi all, I'm having a little trouble with the default timeout for URLDownloadToFile as sometimes the server I'm trying to download info from is taking a little too long to respond. I've seen in some posts years ago that a default timeout was introduced to avoid the script hanging forever http://www.a...
by Xerxes77
08 Nov 2014, 22:17
Forum: Ask For Help
Topic: Merging cells in word table
Replies: 2
Views: 936

Merging cells in word table

Hey everyone, I'm trying to merge cells in a word table but I'm struggling to work out how to do this using COM. Based on what I've read here: http://msdn.microsoft.com/en-us/library/office/ff821310%28v=office.14%29.aspx You can use the Merge/MergeTo method but I've never had any luck implementing a...
by Xerxes77
05 Nov 2014, 04:32
Forum: Ask For Help
Topic: Autohotkeys to Sign in with Email and Password Topic is solved
Replies: 2
Views: 1690

Re: Autohotkeys to Sign in with Email and Password Topic is solved

In the past I've used URLdownloadtoFile to obtain the html of pages which require a login. Though I needed to be logged in at the time for it to work correctly because the URL changed with each login. Then from there I used Regular expressions to extract the text that I wanted. This will probably re...
by Xerxes77
05 Nov 2014, 03:40
Forum: Bug Reports
Topic: Hotkey not working if first Line defines a Class
Replies: 3
Views: 1522

Re: Hotkey not working if first Line defines a Class

Yeah that's really strange.. I was just about to reply saying that the hotkey worked fine for me but then when I upgraded my version from 1.1.14.03 to 1.1.16.05 it stopped working. :?
by Xerxes77
26 Oct 2014, 14:35
Forum: Ask For Help
Topic: Change username to variable
Replies: 27
Views: 5724

Re: Change username to variable

You've actually got it working. You just need to make sure you use SubPat1 and not SubPat: From the RegExMatch Page: "If any capturing subpatterns are present inside NeedleRegEx, their matches are stored in a pseudo-array whose base name is OutputVar. For example, if the variable's name is Match, th...

Go to advanced search