Search found 18 matches

by mojobadshah
14 Feb 2020, 18:43
Forum: Ask For Help
Topic: Alternative to FileSelectFolder, folder - No Gui
Replies: 2
Views: 256

Alternative to FileSelectFolder, folder - No Gui

What path can I substitute for" FileSelectFolder, folder, etc..." in cases where I don't require a Gui to prompt me with an option to manually select a folder to loop through?
by mojobadshah
08 Feb 2020, 13:33
Forum: Ask For Help
Topic: ControlGetText, OutputVar, Edit1, Untitled With Wildcard
Replies: 2
Views: 187

Re: ControlGetText, OutputVar, Edit1, Untitled With Wildcard

You can use ahk_class ahk_id ahk_exe ahk_id instead the window title. Use the Window Spy to get those values. Or you could use SetTitleMatchMode . https://www.autohotkey.com/docs/commands/SetTitleMatchMode.htm Is this for generic filenames and filetypes -- wildcards eg. filename.* or *.filetype for...
by mojobadshah
05 Feb 2020, 19:23
Forum: Ask For Help
Topic: ControlGetText, OutputVar, Edit1, Untitled With Wildcard
Replies: 2
Views: 187

ControlGetText, OutputVar, Edit1, Untitled With Wildcard

I want to use the "ControlGetText, OutputVar, Edit1, Untitled" function, but implement a filename.filetype wildcard eg. *.doc. What is the accurate convention for performing this task?
by mojobadshah
01 Feb 2020, 19:26
Forum: Ask For Help
Topic: RegExMatch for Keyword in Text
Replies: 2
Views: 201

Re: RegExMatch for Keyword in Text

w0z wrote:
30 Jan 2020, 21:57
I barely understand what you want to do. Perhaps this:

Code: Select all

F1::

Loop, Parse, Data, `n, `r
{
	if ( A_LoopField != "" )
	{
		newstr := RegExMatch(A_LoopField, "(keyword)",SubPat)
		if ( SubPat != "" )
		 	new.= SubPat "`n"
	}
}
MsgBox, % new
new =

Return
Yes, that worked perfect!! Thanks.
by mojobadshah
30 Jan 2020, 16:51
Forum: Ask For Help
Topic: RegExMatch for Keyword in Text
Replies: 2
Views: 201

RegExMatch for Keyword in Text

I put this RegExMatch together: Loop, Parse, Data, `n, `r { newstr := RegExMatch(U, "(keyword)", "$1") if ( newstr != "" ) new .= newstr "`n" } It parses text, but renders erroneously. Depending on how I rearrange the function I've seen a digit value returned, a character in substitution for that, o...
by mojobadshah
29 Jan 2020, 13:30
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

I've noticed pretty effectively that regex doesn't work with a lot of data very well. Can you provide an example of an inverse ahk regex that is maybe preceded by an ahk delete function first? A lot going on here. Not sure what example you are looking for and regex works with any string data. I hav...
by mojobadshah
26 Jan 2020, 21:42
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

Maybe the string being fed into the function is really really long? .+ and .* are both valid for their own use cases. if ahk is going slower than expected you may want to specify SetBatchLines, -1 https://www.autohotkey.com/docs/commands/SetBatchLines.htm I've noticed pretty effectively that regex ...
by mojobadshah
03 Dec 2019, 14:50
Forum: Tutorials
Topic: How to optimize the speed of a script as much as possible.
Replies: 102
Views: 87011

Re: How to optimize the speed of a script as much as possible.

What is the specific mechanism I need to initiate through AHK to push CPU rate up to at least x2 or ~50% or even more than this ? AHK is single threaded. Each instance of a running script will only ever use a single CPU core. You can SetBatchLines to -1 and change the process priority to above norm...
by mojobadshah
29 Nov 2019, 14:26
Forum: Tutorials
Topic: How to optimize the speed of a script as much as possible.
Replies: 102
Views: 87011

Re: How to optimize the speed of a script as much as possible.

Anyone have problems with an AHK script that at first sight works (in my case it's a RegExReplace function), but after a few parses the file (or appended file) will reduce to 0kb? I'm running 1 ahk regex script on a file that's a little bit over 1000kb. I can delete data from these files or apply t...
by mojobadshah
28 Nov 2019, 17:43
Forum: Tutorials
Topic: How to optimize the speed of a script as much as possible.
Replies: 102
Views: 87011

Re: How to optimize the speed of a script as much as possible.

WAZAAAAA Anyone have problems with an AHK script that at first sight works (in my case it's a RegExReplace function), but after a few parses the file (or appended file) will reduce to 0kb? I'm running 1 ahk regex script on a file that's a little bit over 1000kb. I can delete data from these files o...
by mojobadshah
23 Nov 2019, 17:19
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

Maybe the string being fed into the function is really really long? .+ and .* are both valid for their own use cases. if ahk is going slower than expected you may want to specify SetBatchLines, -1 https://www.autohotkey.com/docs/commands/SetBatchLines.htm It would appear that in order for js regex ...
by mojobadshah
22 Nov 2019, 20:03
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

What's the standard conversion for regex '.+' for example:

Code: Select all

NewStr := RegExReplace(NewStr, ".+(anyword).+","")
AHK regex, popularly, appears to favor ' .* ' but I've also seen posts inclusive of ' .+ ' so why would using the latter ' .+ ' cause ahk to lag and not fully process?
by mojobadshah
22 Nov 2019, 13:22
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

I think the approach is a little brittle. It's basically string replacement. An immense thanks to you for helping me to sort this out. This is eventually how put it all together to form a working ahk script: ControlGetText, NewStr, Edit1, Untitled - Notepad ; { NewStr := RegExReplace(NewStr, "([<])...
by mojobadshah
21 Nov 2019, 17:45
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

I think you should just post the file you are working with and the ideal output. I'm not understanding most of your posts. for example "newstring" has no meaning to me. `n is a newline, ASCII character 13 Right now when I run this ahk.... ControlGetText, Data, Edit1, Untitled - Notepad ; { Data := ...
by mojobadshah
21 Nov 2019, 13:45
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

NewStr := RegExReplace(file, "\n", "[formerly newline]") ; => Mary<John<Mary[formerly newline][formerly newline]couple newlines[formerly newline]end I don't really understand what is being attempted with the loop, parse portion of your question. I prefer StrSplit() Thank you for your response. Your...
by mojobadshah
20 Nov 2019, 14:12
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

Neither \n or 'n is a recognized regex expression in this setting for rendering a newline in a character string. What regex expression should I use to form a newline in a string of text? \n is acceptable. https://www.autohotkey.com/docs/misc/RegEx-QuickRef.htm also mentions ") Circumflex (^) matche...
by mojobadshah
20 Nov 2019, 00:06
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

Re: How to translate javascript regex to AHK ?

Neither \n or 'n is a recognized regex expression in this setting for rendering a newline in a character string. What regex expression should I use to form a newline in a string of text?
by mojobadshah
19 Nov 2019, 13:11
Forum: Ask For Help
Topic: How to translate javascript regex to AHK ?
Replies: 18
Views: 1190

How to translate javascript regex to AHK ?

I have coded a javascript + regex input function like this: <input type="button" onclick=" document.getElementById('example').value = document.getElementById('example').value.replace(/([<])/gmi,'\n\n\n$&');" value="EXAMPLE"> and I would like to recode this so that it works as an Autohotkey (AHK) reg...

Go to advanced search