Search found 6259 matches

by jeeswg
12 May 2019, 02:08
Forum: Ask For Help
Topic: Some Basic Regex group Capture / Non-Capture Questions Topic is solved
Replies: 10
Views: 265

Re: Some Basic Regex group Capture / Non-Capture Questions Topic is solved

See \K and (?<=...) [look-behind], mentioned here: Regular Expressions (RegEx) - Quick Reference | AutoHotkey https://autohotkey.com/docs/misc/RegEx-QuickRef.htm string := "Hello World" pos := RegExMatch(string, "Hello\s\KWorld", var) MsgBox, % pos "," var pos := RegExMatch(string, "(?<=Hello\s)Worl...
by jeeswg
11 May 2019, 19:02
Forum: Scripts and Functions
Topic: cover window region
Replies: 3
Views: 546

Re: cover window region

Here is a simple example to cover a window region. There is some more complicated code in the OP above. ;================================================== ;cover a window region (simple example) ;================================================== #NoEnv AutoTrim, Off SetBatchLines, -1 #SingleInstan...
by jeeswg
11 May 2019, 11:04
Forum: Tips and Tricks
Topic: jeeswg's sort algorithms mini-tutorial
Replies: 0
Views: 95

jeeswg's sort algorithms mini-tutorial

This tutorial explains, and gives example code for, 6 algorithms: selection sort insertion sort bubble sort merge sort quicksort (simple logic) quicksort (in place) All code examples use iterative approaches. No recursive approaches are used. Explanations: ===========================================...
by jeeswg
11 May 2019, 04:11
Forum: Wish List
Topic: One Line If Statements
Replies: 36
Views: 1799

Re: One Line If Statements

To me, ideally, conceptually, this should be one line, and so braces shouldn't be needed: ;current: { var := 1 break } ;not possible: var := 1, break ;not possible: var := 1 , break Here's some code, for Notepad (or any Edit control), to 'append' break/continue to a one-liner. That is, to add braces...
by jeeswg
10 May 2019, 20:07
Forum: Wish List
Topic: One Line If Statements
Replies: 36
Views: 1799

Re: One Line If Statements

- Thanks for the example. - Well, at least I know it's unlikely to be implemented, but I do wonder if some convenient solution is possible. - One use would be to quickly translate Python code. - One real-world scenario is: I want to temporarily add a MsgBox before a break/continue. - So that means a...
by jeeswg
10 May 2019, 19:33
Forum: Wish List
Topic: Swap / ObjSwap / Assign / Sign
Replies: 5
Views: 289

Re: Swap / ObjSwap / Assign / Sign

- I've essentially completed my Wish List 2.0. - These, and IsNum/Num, in another thread, are the functions I am 50/50 on. - Swaps are common in mathematical/sort algorithms. - I'd rather use some kind of Swap function, than 3 assignments. - Sign is a built-in function in Excel for example. And is a...
by jeeswg
10 May 2019, 17:32
Forum: Ask For Help
Topic: Get Window Title at Specific Coordinates
Replies: 23
Views: 364

Re: Get Window Title at Specific Coordinates

- The definition specifies a struct, not a pointer to a struct, - If it wanted a pointer to a struct, you could use VarSetCapacity and NumPut, and pass the address. - In this case, you must pass an 8-byte integer directly as a value. - You can form that 8-byte integer by using bitshift and bitwise-o...
by jeeswg
10 May 2019, 12:26
Forum: Ask For Help
Topic: Multiple Image Search (150-200 at once) Is it Possible?
Replies: 12
Views: 283

Re: Multiple Image Search (150-200 at once) Is it Possible?

One idea could be to: select all in the web browser, copy to the clipboard, and then retrieve the raw html from the clipboard: Parsing and precise placement of data contained in clipboard - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=5&t=61317&p=261113#p261113 There might be s...
by jeeswg
10 May 2019, 11:06
Forum: Ask For Help
Topic: Get Window Title at Specific Coordinates
Replies: 23
Views: 364

Re: Get Window Title at Specific Coordinates

@anyone using DllCall: Just FYI, this change has been made to AHK v2: AutoHotkey v2 alpha (UPDATES) - Page 3 - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=37&t=2120&p=275703#p275703 Disabled unquoted arg and return types for DllCall. I'll update this script at some point: DllC...
by jeeswg
10 May 2019, 10:27
Forum: Ask For Help
Topic: Use modifier key to toggle between launching script vs editing script
Replies: 6
Views: 205

Re: Use modifier key to toggle between launching script vs editing script

I use Shift+Enter to open a file/folder with a secondary program:
Quicker way to open script file for editing - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26638
by jeeswg
10 May 2019, 08:42
Forum: Ask For Help
Topic: File paths and arrays
Replies: 3
Views: 115

Re: File paths and arrays

- Some ideas. - The paths are stored in an array. - The last bit of the path is changed if the hotkey w is pressed. - HasKey is used to check if a key exists in an array. - FileExist is used to check if a file/folder exists. oArray := {} oArray.1111 := "C:\1111\Dir1" oArray.2222 := "C:\2222\Dir1" q:...
by jeeswg
10 May 2019, 08:14
Forum: Ask For Help
Topic: Automate windows folders (sort by date, name, etc)
Replies: 7
Views: 214

Re: Automate windows folders (sort by date, name, etc)

- I found out from drozdman that you can use the SortColumns property. - Here's an example: ;e.g. columns: ;prop:System.ItemNameDisplay; ;Name ;prop:System.DateModified; ;Date modified ;prop:System.DateCreated; ;Date created ;prop:System.ItemTypeText; ;Type ;prop:System.Size; ;Size #IfWinActive, ahk...
by jeeswg
10 May 2019, 07:54
Forum: Ask For Help
Topic: Create new folder in Explorer? Topic is solved
Replies: 6
Views: 169

Re: Create new folder in Explorer? Topic is solved

- I would do it like this: #IfWinActive, ahk_exe explorer.exe ^g:: ;create new folder SendInput, ^+n return #IfWinActive - Note: I use n, not N, N is equivalent to shift+n. (I tested, and SendInput, ^N worked, although I prefer ^+n for clarity.) - Note also (repeating gregster): #If and #IfWinActive...
by jeeswg
10 May 2019, 04:50
Forum: Ask For Help
Topic: Basic Script
Replies: 8
Views: 235

Re: Basic Script

On my PC, the # key, has ~ as the secondary character.
So for me, the ~ key, is really the # key.
So I'd do this:
$#::SendInput, ^{#}
$ is to prevent the key sending itself in an infinite loop.
by jeeswg
09 May 2019, 23:27
Forum: Wish List
Topic: One Line If Statements
Replies: 36
Views: 1799

Re: One Line If Statements

Being able to do something like this, outside of a switch statement, by some means, would still be very useful, especially when writing code at speed:

Code: Select all

;before:
if (condition)
{
	ismatch := 1
	break
}

;after:
if (condition)
	ismatch := 1
	, break
by jeeswg
09 May 2019, 21:40
Forum: Wish List
Topic: One Line If Statements
Replies: 36
Views: 1799

Re: One Line If Statements

- In this test build, a switch statement has been implemented, which in my view negates the need for one-line if-statements, and the need for bunching up multiple lines of code into one line. Test build - InputHook, long paths, switch-case - AutoHotkey Community https://autohotkey.com/boards/viewtop...
by jeeswg
09 May 2019, 20:08
Forum: Ask For Help
Topic: Cos and ACos trouble Topic is solved
Replies: 4
Views: 104

Re: Cos and ACos trouble Topic is solved

Even Excel, which is great for simple user functions, uses radians not degrees. This surprised me when I first discovered it. I give some sample code in this link: Math Functions - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=37&t=54366&p=234966#p234966 I proposed some ideas li...
by jeeswg
09 May 2019, 09:55
Forum: Wish List
Topic: Swap / ObjSwap / Assign / Sign
Replies: 5
Views: 289

Swap / ObjSwap / Assign / Sign

- Swap (or VarSwap cf. VarExist) / ObjSwap (or ObjSwapKeys) / Assign / Sign. - If built-in, you would probably use them, otherwise, you would use more verbose or cryptic code. - They add clarity and elegance to scripts, and are more instructive, regarding intention, than the alternatives. - They als...
by jeeswg
09 May 2019, 04:12
Forum: Ask For Help
Topic: Shortening the use of IF in simple tasks
Replies: 5
Views: 149

Re: Shortening the use of IF in simple tasks

For that specific example:

Code: Select all

num := Mod(ch, 4)
if (num = 1)
	...
else if (num = 2)
	...
else if (num = 3)
	...
else
	...
by jeeswg
08 May 2019, 06:47
Forum: Forum Issues
Topic: something weird going on with this thread
Replies: 6
Views: 195

Re: something weird going on with this thread

I've mentioned this issue in 2 threads:
forum listings not updated - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=3&t=56810
Maintenance - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=3&t=57115

Go to advanced search