Search found 349 matches

by sinkfaze
22 Mar 2016, 17:00
Forum: Ask For Help
Topic: Help with && clean up.
Replies: 1
Views: 264

Re: Help with && clean up.

You can test this, this would replace your existing code as posted. If your variables have their Boolean values, the message box should show the appropriate phrase to be sent: A16B := SubStr(A16, 61 , 29) print := {"00000":"8{ENTER}" A16A "{ENTER}" ,"10000":"9{ENTER}" A16A "{ENTER}" ,"01000":"9{ENTE...
by sinkfaze
22 Mar 2016, 13:40
Forum: Ask For Help
Topic: Array size limit?
Replies: 2
Views: 435

Re: Array size limit?

I write a 2-D array with almost 70K arrays written into it every day and have not had a problem like that to date.

Is there an error that accompanies the "freak out"?
by sinkfaze
21 Mar 2016, 10:41
Forum: Ask For Help
Topic: Find nearest Friday
Replies: 4
Views: 301

Re: Find nearest Friday

Try this one:

Code: Select all

lastFriday :=	A_Now
if	(A_WDay<>6)
	lastFriday +=	-((A_WDay>6) ? 1 : (A_WDay+1)), Days
FormatTime, out, %lastFriday%, MM/dd/yyyy
MsgBox %	out
return
by sinkfaze
21 Mar 2016, 08:11
Forum: Ask For Help
Topic: Find nearest Friday
Replies: 4
Views: 301

Re: Find nearest Friday

There's a difference between the "nearest" Friday and the "most recent" Friday. Do you mean:
  • The closest previous Friday,
  • The closest future Friday, or
  • The closest Friday, past or future, to the current date?
by sinkfaze
16 Mar 2016, 15:06
Forum: Ask For Help
Topic: question regex search help please Topic is solved
Replies: 3
Views: 460

Re: question regex search help please Topic is solved

I agree with Paneb, the goal here is kind of vague, particularly since what you appear to want doesn't even show up in your example: AAA=(123) (1234) (12345) (123456) (1234567) (54321) Pos=1 While Pos := RegExMatch(AAA,"\(\K\d+(?=\))",m,Pos+StrLen(m)) { sum := 0 Loop, parse, m sum += A_LoopField Msg...
by sinkfaze
15 Mar 2016, 07:22
Forum: Ask For Help
Topic: How to write a script for saving popup numbers to clipboard
Replies: 7
Views: 377

Re: How to write a script for saving popup numbers to clipboard

If the yellow box is from Citrix, the program that generated the yellow box is from Citrix too.

There aren't a lot of options for AHK to interact with a program via Citrix without the AHK script being run on the Citrix side server.
by sinkfaze
14 Mar 2016, 10:21
Forum: Ask For Help
Topic: How to write a script for saving popup numbers to clipboard
Replies: 7
Views: 377

Re: How to write a script for saving popup numbers to clipboard

Try this: !c::MsgBox % (Clipboard := GetTextUnderMouse()) GetTextUnderMouse() { Acc := Acc_ObjectFromPoint(child) try value := Acc.accValue(child) if !value try value := Acc.accName(child) return value } Acc_ObjectFromPoint(ByRef _idChild_ = "", x = "", y = "") { Acc_Init() If DllCall("oleacc\Access...
by sinkfaze
07 Mar 2016, 14:48
Forum: Ask For Help
Topic: Question on object, array. How can I "index match" with two arrays?
Replies: 5
Views: 356

Re: Question on object, array. How can I "index match" with two arrays?

Using a for-loop, for example:

Code: Select all

states :=   ["NY","CA","IL"]
 
For i, state in states
{} Until (state="NY")
MsgBox, "NY" was found at position #%i% in the array.
return
by sinkfaze
07 Mar 2016, 14:08
Forum: Ask For Help
Topic: Question on object, array. How can I "index match" with two arrays?
Replies: 5
Views: 356

Re: Question on object, array. How can I "index match" with two arrays?

Can you use an object instead? cities := {CA:"Los Angeles",NY:"New York,IL:"Chicago"} Otherwise, so long as you are putting the cities and their related states into their respective arrays in the same order, you can share the index number: cities := ["Los Angeles","New York","Chicago"], states := ["...
by sinkfaze
07 Mar 2016, 10:21
Forum: Ask For Help
Topic: how to select the cell which contains specific value? Topic is solved
Replies: 12
Views: 1813

Re: how to select the cell which contains specific value? Topic is solved

xl := ComObjActive("Excel.Application") return F1:: xl.Range("A1:B50").find("#N/A",xl.ActiveCell, xlValues := -4163).activate return Error: 0x80020005 - Type mismatch. 5ource: (null) Description: (null) HelpFile: (null) HelpContext: 0 Specifically: Find LineS 001: xl := ComObjActive(”Excel.Applicat...
by sinkfaze
07 Mar 2016, 10:09
Forum: Ask For Help
Topic: SetTimer with "if" conditions?
Replies: 9
Views: 920

Re: SetTimer with "if" conditions?

Yes, well, I guess it's resetting the period on the timers, so they never execute because they keep getting reset every time through the loop. You would need to set a flag to indicate if they're already in one state and then set them only when the state changes. Or a handy function that tells you w...
by sinkfaze
07 Mar 2016, 08:46
Forum: Ask For Help
Topic: Search a CSV File
Replies: 10
Views: 1281

Re: Search a CSV File

If you're questioning how quickly AHK can parse the CSV file, do a simple benchmark test:

Code: Select all

start :=	A_TickCount
Loop, Read, %A_ScriptDir%\68135.csv
	i :=	A_Index
MsgBox %	"Parsed " i " lines in " (A_TickCount-start)//1000 " seconds."
by sinkfaze
04 Mar 2016, 10:40
Forum: Ask For Help
Topic: Reversing a number
Replies: 11
Views: 804

Re: Reversing a number

If you're not overly concerned with potential overhead:

Code: Select all

sentence :=	"This is the longest sentence that I can think of right at this moment and I want to see how quickly it can be reversed."
c :=	StrSplit(sentence), m :=	c.MaxIndex()+1
Loop %	m-1
	out .=	c[m-A_Index]
MsgBox %	out
by sinkfaze
04 Mar 2016, 00:34
Forum: Ask For Help
Topic: Search a CSV File
Replies: 10
Views: 1281

Re: Search a CSV File

I don't think that your OmitChars parameter in your StringSplit statements is correct. On a CSV loop read you shouldn't need to omit newlines or carriage returns because those are the loop's default delimiters. And there's no need for the excess comma, either. StringSplit, item, A_LoopReadLine, |
by sinkfaze
04 Mar 2016, 00:22
Forum: Ask For Help
Topic: Count duplicates in an associative array
Replies: 14
Views: 1640

Re: Count duplicates in an associative array

I'm pretty late to this party, but the proposed method in the OP is a pretty complex way of counting duplicates, no? ;RegFile = ;(LTrim Join`r`n ; "3282380034842";"1-1926406" ; "3282390024423";"1-1926001" ; "3282390034842";"1-1926406" ; "3360100080102";"FLAV3" ; "3282370034842";"1-1926406" ;) RegFil...
by sinkfaze
01 Mar 2016, 12:40
Forum: Ask For Help
Topic: RegEx Help Line Should End with Period, if no period at the end of line.
Replies: 11
Views: 1111

Re: RegEx Help Line Should End with Period, if no period at the end of line.

As an addendum to AlphaBravo's code, if you have trailing horizontal whitespace and would like to preserve it: string= ( Say no to 1 hour meetings Following line is empty Do the Steve Jobs walk. Visualize your success ) string.= "`nWhite spaces at end of line " MsgBox % RegExReplace(string,"`ams)[^\...
by sinkfaze
01 Mar 2016, 08:34
Forum: Ask For Help
Topic: RegEx Help Line Should End with Period, if no period at the end of line.
Replies: 11
Views: 1111

Re: RegEx Help Line Should End with Period, if no period at the end of line.

Code: Select all

string=
(
Say no to 1 hour meetings
Do the Steve Jobs walk.
Visualize your success  
)

MsgBox %	RegExReplace(string,"`am)[^\.]$","$0.")
by sinkfaze
29 Feb 2016, 11:36
Forum: Ask For Help
Topic: Loop Question
Replies: 13
Views: 712

Re: Loop Question

I have added code tags to the appropriate posts. Confusedatwork3, When you reply on a topic, if you see a button named "Full Editor & Preview", click it and it will take you to a different page with a series of buttons just above the reply text box. One of the buttons is the "Code" button, if you hi...
by sinkfaze
26 Feb 2016, 09:49
Forum: Ask For Help
Topic: How can i make a hotkey work different at different areas of same excel sheet?
Replies: 3
Views: 389

Re: How can i make a hotkey work different at different areas of same excel sheet?

Since I like to keep Excel pointers for as little time as possible to avoid other potential errors:

Code: Select all

if	!RegExMatch(ComObj("Excel.Application").Selection.Address[0,0],"^([A-Z]+)(\d+)$",c)
	return
if	(c1 ~= "[A-H]") && (c2 <= 100)
		Send test1
	else	Send test2
return
by sinkfaze
25 Feb 2016, 12:23
Forum: Ask For Help
Topic: #IfWinExist - Microsoft Word
Replies: 11
Views: 1044

Re: #IfWinExist - Microsoft Word

Look here also for advice.

Go to advanced search