Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

37 Ahk enhancements


  • Please log in to reply
20 replies to this topic
Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
following is about half my Ahk journal, in categorized fashion, minus the least important suggestions, feature requests better left to functions, & miscellaneous notes. These rankings are my own, input is welcome.

-------------------
Enhancements
-------------------
- fix ControlSend to behave like Send when using {+}{^}{!}{{} etc.
- fix Winup Hotkeys so StartMenu doesnt appear. 1.0.30.0 dealt with similar problem
`s escape sequence for one literal space. better than typing {space}
- clipboard support to treat all whitespace chars as non-empty
for both expression method and traditional method comparisons
- A_LineFeed variable (like A_Space and A_Tab)
- A_SoundPlay, =1 if Ahk is playing a sound/video, =2 if another application is doing so
- wildcard-suffix support for variables, allowing multiple assignments with one line
useful for setting two or more vars beginning with the same characters
convenient for arrays
- key-remapping, support for activation under hotkey. more versatility in .ini/24/7 script
allow 2+ instances of remapping the same key, to be able to restore the original
- IfMsgBox support for responses to external message boxes (not originated by Ahk)
- make all error-alert windows AlwaysOnTop/Topmost, e.g. reload-error & max-reached alerts
- support for gui URLs
- enable nonzero thread-Priority comparisons

---------------
Preferences
---------------
- main-window menu command to ignore history of timer threads, individually if possible
- SetTimer "now", optional parameter to have effect immediately without waiting the interval
SetTimer, Label [, Period|On|Off [now], Priority]
useful for significant intervals where a countdown to start is unfeasible
- KeyWait millisecond support
- KeyWait, ability to check for keys belonging to a user-specified set
KeyWait, KeyName|KeyList|any [, Options]
"any" serves as a keyboard-input flag
- standardize all sec/ms time-parameter notation to seconds specification
TimeSpec 0|1 0-old(default) 1-standardized, with millisec support
- FileGetID, command to retrieve a file's unique identifiers
FileGetID, OutputVar, Cmd [all], InputVar
specifying "all" in Cmd will perform each Cmd and create array suffixes:
OutputVarPath, OutputVarPID, OutputVarCLSID, OutputVarMD5
Cmd may be any one of the following: Path (FileFullPath) | PID | CLSID | MD5 | all
InputVar may be any one of the following: Path | PID | CLSID
ErrorLevel is 1 if InputVar has no matching item
- BlockInput: 1) optional params for specific keys. 2) modify to accept key-up commands
- Thread termination command. identification by label of hotkey or subroutine
- enhance Send to match the speed of ControlSend
noticeable difference after switching to diff window than the one script is using
- fix hotkey-triggering so that Alt need not be pressed if AltDown was sent
interception of hotkey-presses to auto-include modifier during modifierDown
fix for all modifierDown commands
possible support for remapped keys
/** same as the ; comment flag, except
used only on a line indicating a Loop or If block
the entire block is automatically commented. convenient for debugging
- support for integer exponentiation of negative integer base
- Main Window, modify "Hotkeys and their methods"
include every subroutine & timer
indicate priority of each
show full scriptline for every line which has a hotkey/subroutine/timer label
possibly omit commentive semicolons
enables this table to act as a labeled index of routines
- WinGet, MinMax- or new-parameter support to identify which windows are hidden
- support for gui sub-menus
- support for gui item re-size using magnification ratio

----------------
Long-Range
----------------
- research the possibility of literally simultaneous Threads
employing hyper-threading technology of the newest processors
- KeyWait support for key-combinations/macro-calls
- Exclude/IncludeTitle/Text support for multiple entries
| may be used as a separator, with spaces before and after
- Pause support to disregard routine which invokes it, but to apply to previous thread
Pause[, On|Off|Toggle, 0|1] 0=old method/default; 1= no effect on invoking routine
- optional dll/plug-in for scientific calculations and business functions
- display-list feature showing non-Ahk hotkeys-in-use
indicating which belong to application of active window
- RemapRestore, built-in function to restore to original keyboard layout

----edited/added:
- ClearVar, command to clear contents for user-specified variables
ClearVar, Options, varList
Options: 0, all; 1, non-timer vars; 2, all vars in current thread; blank, use list
varList used with a number option means the List is exceptions
- optimized-compile ability, which excludes code of unused Ahk commands/features
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

following is about half my Ahk journal

It's great that you've been keeping notes. So many good observations and ideas wind up forgotten because they're never written down.

- fix ControlSend to behave like Send when using {+}{^}{!}{{} etc.

It seems to work okay already. Try this script:
#space::  ; win+Space hotkey.
IfWinNotExist Untitled - Notepad
{
	Run Notepad
	WinWait Untitled - Notepad
}
ControlSend, Edit1, {{}{+}   ; Uses last found window.
return

- fix Winup Hotkeys so StartMenu doesnt appear. 1.0.30.0 dealt with similar problem

The following example seems to work okay. Perhaps you could post a non-working example to help fix it:
#z::
#z up::
ToolTip %A_ThisHotkey%
return

`s escape sequence for one literal space. better than typing {space}

That's interesting and although there is slight risk that it would break existing scripts that rely on `s being the same as "s", I'll research it further. You probably already know that you can have literal spaces in between keystrokes of the send command such as Send Words with spaces.. If not, maybe that would lower your priority estimation for this.

- clipboard support to treat all whitespace chars as non-empty
for both expression method and traditional method comparisons

I could use clarification on this one because the following example already seems to indicate that this already works:
clipboard := " "
ClipWait 0.1
if ErrorLevel
	MsgBox This should never appear.
if Clipboard =
	MsgBox This should never appear.
if Clipboard <> %A_Space%
	MsgBox This should never appear.
if (Clipboard <> " ")
	MsgBox This should never appear.
return

- A_LineFeed variable (like A_Space and A_Tab)

I don't think it's needed because you can use `n to indicate a linefeed (and `r for a carriage return).

- A_SoundPlay, =1 if Ahk is playing a sound/video, =2 if another application is doing so

I don't know of a way to detect whether other apps are playing sound/video but this is an interesting idea for whether the script (or any script) is playing something. However, better support for MCI commands is planned in the future, which should cover this in addition to allowing you to pause a playing sound/video, play multiple things simultaneously, etc.

- ClearVar, command to clear contents for user-specified variables (non-reserved)
clears all non-reserved variables if no vars are specified
- wildcard-suffix support for variables, allowing multiple assignments with one line
useful for setting two or more vars beginning with the same characters
convenient for arrays

You probably know already that you can clear a variable by assigning a blank value to it; e.g. Var =. The wildcard idea is quite interesting, especially for arrays as you said. However, I don't know if the savings would be worth it since you can already do this with two lines:
Loop %ArrayCount%
    Array%A_Index% =

- InitReset command, which employs a block containing variables and assigned values
when used in Config section:
resets variables to user-defined values after each completed, non-function routine.
when used outside of Config section:
the local variable block is used in place of Config block.

Perhaps you could give an example on how the syntax might look for this, and what kind of project it would help with.

- key-remapping, support for activation under hotkey. more versatility in .ini/24/7 script
allow 2+ instances of remapping the same key, to be able to restore the original

Could use clarification on the above, perhaps via some short examples.

- IfMsgBox support for responses to external message boxes (not originated by Ahk)

Useful, but probably outside the scope of the project for now because I think it would require a system-wide message-monitoring hook.

- make all error-alert windows AlwaysOnTop/Topmost, e.g. reload-error & max-reached alerts

My feeling is that it's better not to have them always-on-top because it's too invasive. When a script yields an error dialog, the dialog does forcefully steal focus; but after that it seems best not to keep it forced into the foreground in case the user wants to leave it there and come back to it after working on something more important (something for which an always-on-top window would be annoying).

- support for gui URLs

I think there's a standard way to do this so will try to get it into a future version.

- enable nonzero thread-Priority comparisons

I think I understand but it would help to have a real-world example of what this would be used for and how it would be used.

- main-window menu command to ignore history of timer threads, individually if possible

I can see how this would be very useful. I'll put it on the to-do list.

- SetTimer "now", optional parameter to have effect immediately without waiting the interval

You probably already know that you can achieve this simply by adding Gosub Label after SetTimer Label. But your proposed improvement seems useful enough and easy enough that it should probably be done. Thanks.

- KeyWait millisecond support

Seems unnecessary because you can give it a floating point number such as KeyWait, Control, T0.3. This is in the fine print of the documentation.

- KeyWait, ability to check for keys belonging to a user-specified set
KeyWait, KeyName|KeyList|any [, Options]
"any" serves as a keyboard-input flag
- KeyWait support for key-combinations/macro-calls

Have you already explored the Input command and found it inadequate for something? If so, can you give an example of a real-world problem that this KeyWait extension would help solve.

- standardize all sec/ms time-parameter notation to seconds specification
TimeSpec 0|1 0-old(default) 1-standardized, with millisec support

Can you list a few commands you find confusing due to the lack of standardization?

- FileGetID, command to retrieve a file's unique identifiers

I don't know how to get the PIDs of a filename. You probably already kow that you can get the full path of any single file using:
Loop C:\File.txt
    FullPath := A_LoopFileLongPath  ;  This feature was recently added.
CLSID seems interesting; but due to the rarity of typical user wanting it, this will probably be done via an includable function that calls the future function DllCall() to get the info from the Windows API (if feasible).

- BlockInput: 1) optional params for specific keys. 2) modify to accept key-up commands

Probably not feasible because BlockInput() is a "black box" provided by the OS that is pretty much "all or none" type behavior.

- Thread termination command. identification by label of hotkey or subroutine

It's interesting but the need seems rare. Perhaps you can give an example of real world problem(s) this would solve or make easier.

- enhance Send to match the speed of ControlSend
noticeable difference after switching to diff window than the one script is using

Have you tried SetKeyDelay 0 or -1? The Send command is slower because it uses keybd_event(), which apparently is a high-overhead operation. There is an item on the to-do list to look into using SendInput() instead. However, this would probably only improve the reliability (uninterruptibility) and not the speed of the keystrokes.

- fix hotkey-triggering so that Alt need not be pressed if AltDown was sent
interception of hotkey-presses to auto-include modifier during modifierDown
fix for all modifierDown commands

Some examples would help fix this.

possible support for remapped keys

This is a good idea and is planned. I was thinking something like the following could be workable:
LControl::LWin  ; Make left-control become LWin.

/** same as the ; comment flag, except
used only on a line indicating a Loop or If block
the entire block is automatically commented. convenient for debugging

Seems cool but I wonder if there's some reason other languages do not allow this sort of thing. Perhaps because it is hard to see that a really block is commented out if you're scrolled down to the bottom and the /** is off the screen higher up.

- support for integer exponentiation of negative integer base

The reason it's not supported now is that I think it would require the use of a library function that would bloat the code. But I'll check into it. Edit: Today's v1.0.44.11 has the following:
Changed/improved the ** operator and "Transform Pow" to support negative bases when the exponent isn't fractional. [thanks Laszlo]
Related topic: http://www.autohotke...pic.php?t=12267

- Main Window, modify "Hotkeys and their methods"
include every subroutine & timer
indicate priority of each
show full scriptline for every line which has a hotkey/subroutine/timer label
enables this table to act as a labeled index of routines

These seem useful but of somewhat low priority (I'm thinking here of how often the typical user would benefit). But I'll add it to the to-do list.

...possibly omit commentive semicolons

Comments are already excluded from ListLines, but maybe you meant something else.

- WinGet, MinMax- or new-parameter support to identify which windows are hidden

Some way of more easily detecting whether a window is hidden would be good. If there's more to this idea, please clarify.

- support for gui sub-menus

Menu bars can already have many levels of submenus; but maybe you meant something else.

- support for gui item re-size using magnification ratio

An example of what it would be used for would help determine its priority.

- research the possibility of literally simultaneous Threads
employing hyper-threading technology of the newest processors

Multiple real threads would be a good feature and something that I've mulled over since the beginning. One reason for it being a lower priority is that any thread that sends keystrokes or activates windows should generally not have to compete with other threads that are simultaneously trying to do the same.

- Exclude/IncludeTitle/Text support for multiple entries
| may be used as a separator, with spaces before and after

There is a plan to support wildcards for title and text matching. For other needs, WinGetTitle+IfInString is probably justified given the rarity of the need (even exclude-title/text are probably used by less than 5% of users).

- Pause support to disregard routine which invokes it, but to apply to previous thread
Pause[, On|Off|Toggle, 0|1] 0=old method/default; 1= no effect on invoking routine

That sounds useful; it would help to know a real-world use if you can think of one. I could probably think of some too.

- optional dll/plug-in for scientific calculations and business functions

Someday when you get time, post some more specifics about this. Perhaps someone with the know-how would step in to help develop it.

- display-list feature showing non-Ahk hotkeys-in-use
indicating which belong to application of active window

I don't know of any reliable means of finding out this info.

- RemapRestore, built-in function to restore to original keyboard layout

You probably already know about the Suspend command and had something else in mind.

Thanks for all these suggestions; this is by far the most extensive list I've ever received and I really appreciate it (more are welcome).

Edit: Added more info above to "support for integer exponentiation of negative integer base".

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
Thanks Chris for all the work you do on this outstanding, top notch program, on both the coding and in the forum. Thanks for your detailed responses. The following is the revised list; I've omitted items which were mistakes on my part, redundant, impossible, or brainstorming which I'm not sure what I was thinking... or functions on which I'm working.

27

-------------------
Enhancements
-------------------
A_CPUuse, cpu usage level as would be indicated in Task Manager; 100 is 100%
default off, with user-settable polling frequency, each thread with own setting.
Polling stops when the invoking thread is terminated.
This allows trends of cpu usage to be detected by the script if the user wishes a background script to not run during a specified total cpu usage threshold.
SetCPUuse, on, <polling interval>
Loop
{
	Loop 10
	{
		sleep 500
		x1+=%A_CPUuse%
		if A_index=10
			cpuUse:=x1/10
	}
	if cpuUse<%desiredBackgroundThreshold%
	{
		...
	}
	ExitCheck()
}
return

Execute,
parameter may be a variable which resolves to a command line.
Exec may be used in place of Execute.
This allows for the third major type of programs (after batch & interactive), RMC (runtime morphable code), or PII (program-interactive interface), where code can be generated by the program depending on the variable environment, and the virtual lines of code can be deleted after return from execution within a function, to optimize speed.
Code may be retrieved from files (as functions can), or stored in memory as variables for later call, or access by other PII programs.
This type of program need not be terminated in order to be modified.
Msgbox AI Layer 1
return

Execute, Msgbox AI Layer 1
return

2005=Msgbox AI Layer 1
Exec %2005%
return

;-----------	The above 3 are equivalent.

varCmd=Msgbox, Execute allows command elements to be parsed, created, modified, incremented, or recombined, according to variable environment and derived output.
if flag=1
{
	Function1(flag2)
	if flag2=1
		Load()
; next is to parse and modify the desired command
	Calc(varCmd)		
}
Execute %varCmd%
SetTimer2(flag3)
return
variable naming, support for "." within a variable name
Clear, disassociate variables from memory.
I'm not sure what this would entail besides releasing the address pointer & varName.
-Useful with programs involving dynamic parameters; graphics; and variable sets which total more than 1 or so MB
Clear, var [, var2, var3 ...]
Perhaps default to apply to last referenced in code if no parameters are given.
Function command to switch a variable's type
can be used in an If block.
AutoSizeW - Gui,Show option which uses the specified width as a lower limit
Keeps the title visible if the user desires.
Gui, Show, AutoSizeW w300
#ErrorAlert, sets type of error alert windows, e.g. reload-error & max-reached alerts
ErrorAlert, option (one of the following:)
0, suppressed; 1, normal; 2, minimized; 3, AlwaysOnTop
AlwaysOnTop would help if you have many windows open, including an AlwaysOnTop.
main-window menu command to ignore history of timer threads, individually if possible
Thread termination command. identification by label of hotkey or subroutine
Xit hotkey/subroutineLabel
-allows creation of self-monitoring programs, in which deviant output would trigger separate monitoring thread(s) to optionally alert user, store relevant variables, terminate problem routines & optionally restart them.
This could also be used for immediate conditional switching of routines depending on the variable environment.
SetTimer "now", optional parameter to have effect immediately without waiting the interval
-useful for significant intervals where a countdown to Stop/start is unfeasible
-makes possible the use of convergent timers (self-adjusting intervals).
SetTimer, Label [, Period|On|Off [now], Priority]
Pause support to disregard routine which invokes it, but to apply to previous thread.
Pause[, On|Off|Toggle, 0|1]  0=old method/default; 1= no effect on invoking routine
For automating new routines after relieving CPU of any possible resource-intensive Ahk routines; equivalent to a "global GoSub".
Enables automation of wait/resume without the use of loops or timers, when the target event is generated internally (thru Ahk routine), and when a dialogue box or Win/Control/Key/Mouse Delay would otherwise cause problems by resuming previous threads.
AND/OR support for non-expressions, main reason being speed optimization for large variable sets or iterations exceeding several 100,000x
A_GuiA, gui window number of currently active Gui window, if any.
gui window equivalent of GuiControlGet, OutputVar, Focus
A_Tooltip, # of tooltips in use.
conditional adjustment of tooltip placement after new tooltips from other threads.
A_SoundPlay, =1 if Ahk is playing a sound/video, =2 if another application is doing so
FileGetID, command to retrieve a file's unique identifiers
FileGetID, OutputVar, Cmd [all], InputVar
-specifying "all" in Cmd will perform each Cmd and create array suffixes: OutputVarPath, OutputVarPID, OutputVarCLSID, OutputVarMD5
-Cmd may be any one of the following: Path (FileFullPath) | PID | CLSID | MD5 | all
-InputVar may be any one of the following: Path | PID | CLSID
-ErrorLevel is 1 if InputVar has no matching item
support for gui URLs

----------------
Preferences
----------------
Gui sub-menu support for changing of menu width, multiple column (over scrolling) option, dragging of menu items, and user-settable context menu for active menuItem
`s one-space escape sequence. better than typing {space}
key-remapping, support for toggle under hotkey. more versatility in .ini/24/7 script
-allow 2+ instances of remapping the same key, to be able to restore the original.
syntax suggestion:
#UseHook
#z::
if flagRemap=1
{
	q:::Send q
	flagRemap=
}
else
{
	q:::send w
	flagRemap=1
}
return
/** same as the ; comment flag, except
-used only on a line indicating a Loop or If block
-the entire block is automatically commented. convenient for debugging
IfMsgBox support for responses to external message boxes (not originated by Ahk)
-perhaps include an option on Main Window to turn on the hook, default off.

-----------------------
Other/Long-Range
-----------------------
optimized compiling of scripts, which excludes code of unused Ahk commands/features
dll for database functions & reading of various native file formats
native support for TCP/IP, logging of relevant parameters
literally simultaneous Threads, using hyper-threading technology of the newest processors
optional dll/plug-in for scientific calculations and business functions

Thanks again.

AutoHotkey is the cutting edge of efficiency in programming, along with C series and Euphoria.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks for the revisions and clarifications.

SetCPUuse, on,
...
ExitCheck()

I've raised the priority of researching how to discover the current CPU utilization level. If possible, this will be done as a new variable such as A_CPULoad. The CPU would only be polled each time the script actually accesses the variable at runtime.

I think anything more elaborate than this would be overkill because you can always lower a script's priority, temporarily or permanently, to reduce its CPU utilization. For example: Process, Priority, , Idle. You can also use SetBatchLines to reduce a script's CPU usage.

Execute,

The ability to dynamically execute commands is planned, but might be a while in coming because the benefit to the typical user seems low compared to the amount of development time and the increase in code size that would be required. In the meantime, you might try jonny's execute() function, which handles quite a bit of the proposed functionality.

variable naming, support for "." within a variable name

I was reserving "." for possible use with structures or methods in the future. Although there is no current plan to add these features, it seemed best to retain the possibility.

Function command to switch a variable's type
can be used in an If block.

Could you clarify what you mean by "type"?

AutoSizeW - Gui,Show option which uses the specified width as a lower limit
Keeps the title visible if the user desires.

So this would prevent the window from being narrowed so much that the title is truncated. Good idea; I've made a note of it.

ErrorAlert, option (one of the following:)
0, suppressed; 1, normal; 2, minimized; 3, AlwaysOnTop
AlwaysOnTop would help if you have many windows open, including an AlwaysOnTop.

You can already suppress load-time errors via #ErrorStdOut. AlwaysOnTop and the others seem too rarely needed to justify having this as a feature, but contrary opinions are welcome.

Thread termination command. identification by label of hotkey or subroutine

Xit hotkey/subroutineLabel
-allows creation of self-monitoring programs, in which deviant output would trigger separate monitoring thread(s) to optionally alert user, store relevant variables, terminate problem routines & optionally restart them.
This could also be used for immediate conditional switching of routines depending on the variable environment.

This is interesting but seems too elaborate and obscure to get high priority. You probably know that some of this could be done by setting global variables that threads check periodically (to determine whether they should self-exit). If you have a specific need for something like the above but see no way to get it to work, please describe it since I might have a solution (if not, it would serve as additional justification for adding a built-in feature).

SetTimer "now"

I'll definitely check the feasibility of this and try to add it if it's not too difficult.

Pause[, On|Off|Toggle, 0|1] 0=old method/default; 1= no effect on invoking routine

Thanks for the additional details. I'll look into it.

AND/OR support for non-expressions, main reason being speed optimization for large variable sets or iterations exceeding several 100,000x

I don't think it can be done without breaking existing scripts. Also, I'm pretty sure performance would not be improved that much because expressions are already pretty fast, especially due to short-circuit evaluation.

A_GuiA, gui window number of currently active Gui window, if any.
gui window equivalent of GuiControlGet, OutputVar, Focus

Thanks. I'll look into a more general way than the above to derive a GUI window's number from a window's unique ID. Currently, you would have to use a loop to compare the active window's ID with that of each GUI window until you find a match.

A_Tooltip, # of tooltips in use.
conditional adjustment of tooltip placement after new tooltips from other threads.

I can see that this would be somewhat useful, but the rarity of the need seems to put the priority very low, especially since the script can track how many tooltips it's displaying.

FileGetID, command to retrieve a file's unique identifiers
-Cmd may be any one of the following: Path (FileFullPath) | PID | CLSID | MD5 | all

Given the rarity of the typical user needing this, perhaps you or someone else can look into the possibility of using DllCall to implement it as an includable function (until such time as it gets built in).

Gui sub-menu support for changing of menu width, multiple column (over scrolling) option, dragging of menu items, and user-settable context menu for active menuItem

Multi-column menus are definitely planned. Although I don't know offhand how to implement the other ideas, I'll research them further.

`s one-space escape sequence. better than typing {space}

It's a good idea and I'd definitely do it if it weren't for the breaking of existing scripts. The built-in variable A_Space, while awkward to use, should be used instead.

-allow 2+ instances of remapping the same key, to be able to restore the original.

Although I don't know if completely covers your idea, I'd like to have hotkey/hotstring/remap filters that selectively disable certain hotkeys when certain windows are active. In other words, in some windows the keystroke should pass through normally as though it's a tilde hotkey, but in others it should not pass through and act as a real hotkey.

/** same as the ; comment flag, except
-used only on a line indicating a Loop or If block
-the entire block is automatically commented. convenient for debugging

I've made a note of it but it will probably be a long time in coming because the cost vs. benefit ratio seems unfavorable.

perhaps include an option on Main Window to turn on the hook, default off.

That sounds like a good feature. Thanks.

Other/Long-Range

Good list. Thanks.

Thanks again for the suggestions. They will definitely help improve AutoHotkey in the coming months.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
1) StringUpper/Lower, option to convert to Shifted/unShifted counterpart character.

2) support for arrays with non-numeric subscripts:
var1%var2% = var3 ; currently gives alert "name contains an illegal character"
usefulness in file-loading operations.

3) support for non-reserved strings as default optional parameters, if it doesnt slow performance.

4) WinRestore, NoActivate option.

5) support for the following:
StringReplace, output, input, `r`n ; delete blank lines.

6) WinGet, ProcessName, optional return values:
FileFullPath, FileLongPath, FileShortPath, FileShortName, FileDir.

7) A_Timer, returns the number of running timers and the name of each,
using the same output format as the WinGet List command.

8) SetCursor, ability to change the pointer icon. dll workaround.

9) StringGetPos, options to return positions for:
a) all occurrences,
B) all occurrences except the first.

10) Tooltip, option for manual placement, stationery tooltip.
useful for ongoing visual indicator and when a window is unnecessary; saves space.
Preferable over an AlwaysOnTop window in many cases, being compact & unobtrusive.

11) ListView, user-specified grid-line spacing, instead of at every row and column.
12) ListView, support for independent item # column, not part of any rows.
13) ListView, Recursive-Sort feature
retention of previous sort order for automatic nested sort effect.

14) "variables are not declared; they come into existence automatically."
For variables created in the above manner (i.e. not explicitly assigned an initial
value by the user), fix such variables made in Function Loops to be default local.

15) Parsing Loop, optional user-set length of A_LoopField, overrides right delimiter.
16) Parsing Loop, option to work with original variable instead of a copy.
Loop equivalent of Function ByRef.
Changes made to A_LoopField can be reflected during the loop (needs syntax),
without the need to finish the loop before working with parsed modifications.
Better efficiency and lower memory usage when working w large text variables.

17) key-repeat recognition, built-in variable equals 1 when input is made from key-repeat.
Catches the condition prior to execution of simulated keystroke,
to alter or prevent it, or simply flag it.

18) A_ModKeys, the current keys being pressed if a standard modifier is being pressed
e.g. ^+pq, even if not a hotkey, and not limited to one visible character.

19) MDI/nested subcontrol support for the active applicatiion.
at least for ControlSend, Control EditPaste, ControlSetText; ideally, full support.

20) windowing commands: support for toolbar windows.

21) Ahk main window, word-wrap negation, for scripts which operate on the main window.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

1) StringUpper/Lower, option to convert to Shifted/unShifted counterpart character.

You mean to invert the case of each character in a string? If so, it seems specialized enough that a custom function or subroutine should probably be written for it rather than having a built-in feature.

2) support for arrays with non-numeric subscripts:

This would be a good thing to have. I've made note of it.

3) support for non-reserved strings as default optional parameters, if it doesnt slow performance.

This is tenatively planned, but wasn't quite high enough in priority to get done at the time optional parameters were added.

4) WinRestore, NoActivate option.

You might try the following. If it produces a useful effect for you, I'll either document it in the help file (under WinRestore) or build it in somewhere:
DllCall("ShowWindow", UInt, WinExist("Untitled - Notepad", Int, 4) ; 4 = SW_SHOWNOACTIVATE, 8 = SW_SHOWNA

5) support for the following:
StringReplace, output, input, `r`n ; delete blank lines.

I think you could use the following to delete blank lines (untested):
Loop
{
    StringReplace, MyString, MyString, `r`n`r`n, `r`n, UseErrorLevel
    if ErrorLevel = 0  ; No more replacements needed.
        break
}

6) WinGet, ProcessName, optional return values:
FileFullPath, FileLongPath, FileShortPath, FileShortName, FileDir.

The ability to get the full path is planned, but the others will probably not be implemented since you could use a file-pattern loop and SplitPath to get them.

7) A_Timer, returns the number of running timers and the name of each, using the same output format as the WinGet List command.

This seems too rarely used to have as a built-in feature. However, you might be able to extract this info from the hidden main window (via View > Key History) if you need it.

8. SetCursor, ability to change the pointer icon. dll workaround.

This is planned, at least for GUI windows (need to study up on cursors :))

9) StringGetPos, options to return positions for:
a) all occurrences,
B) all occurrences except the first.

I think you could call StringGetPos or the function InStr() in a loop to do the same thing. The reason things like this tend not to get built in is that they're too rarely used to justify the extra confusion in the docs (from having more parameters and modes). But if others support this idea or any others, that would make it easier to justify.

10) Tooltip, option for manual placement, stationery tooltip.

You can already specify the position of the tooltip via the X and Y parameters. It should be stationary in this case.

11) ListView, user-specified grid-line spacing, instead of at every row and column.
12) ListView, support for independent item # column, not part of any rows.

Difficult to do because I think it requires an owner-drawn ListView, which for now is likely to be too much code.

13) ListView, Recursive-Sort feature retention of previous sort order for automatic nested sort effect.

Do you mean have newly-added rows automatically inserted into the correct positions based on the current sort order?

14) ...fix [uninitialized] variables made in Function Loops to be default local.

Variables in a function should all be local by default. Can you clarify?

15) Parsing Loop, optional user-set length of A_LoopField, overrides right delimiter.
16) Parsing Loop, option to work with original variable instead of a copy.

Although I can see that these would be useful in some cases, they seem too rarely needed to build in (due to code size considerations). Contrary opinions are welcome.

17) key-repeat recognition, built-in variable equals 1 when input is made from key-repeat.

I think the program could detect a repeated key by looking for two down-events in a row. However, I'm wondering if there are enough uses for this to build it in. If so, some thought would have to be put into its syntax (whether it should be a built-in variable, and exactly how it behaves).

18. A_ModKeys, the current keys being pressed if a standard modifier is being pressed

Now that the function GetKeyState() is available, this seems like it adds too little value.

19) MDI/nested subcontrol support for the active applicatiion.
20) windowing commands: support for toolbar windows.

Better child window support is planned, but I've made a note to try to extend it to the commands you mentioned. Thanks.

21) Ahk main window, word-wrap negation, for scripts which operate on the main window.

I've made a note of this. Hopefully it will get added someday as a checkmark menu item in the main window's menu bar.

Thanks for all your suggestions.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004

StringUpper/Lower, option to convert to Shifted/unShifted counterpart character.

I had meant the counterpart char using the same key, which might not be the same letter. In either case, you're right that it's better as a function. Locality-specific keyboard layouts certainly make it the proper solution.

support for arrays with non-numeric subscripts

I've found a workaround that i use in my Easy Input + Unicode script:
temp := EI_Char(char_%Ei_charType%%type#%)

EI_Char(ByRef char)
{
	global charClip
	char := charClip	; Clipboard
	return char
}
It works fine for me; however, the direct method is more convenient, although not a priority.

Quote:

support for non-reserved strings as default optional parameters, if it doesnt slow performance

This is tenatively planned, but wasn't quite high enough in priority to get done at the time optional parameters were added.

This, along with declaration of dynamic variables, will make Function functionality virtually complete.

WinRestore, NoActivate option

I tried the following from your suggestion:
+^r::
DllCall("ShowWindow", UInt, WinExist("Untitled - Notepad", Int, 4)) ; 4 = SW_SHOWNOACTIVATE, 8 = SW_SHOWNA 
return
and nothing happened with 4; with 8, Notepad disappears from the Taskbar.

The StringReplace delete blank lines and Tooltip manual placement suggestions were mistakes on my part; i apologize. I was probably typing late night again.

A_Timer, returns the number of running timers and the name of each, using the same output format as the WinGet List command.


This seems too rarely used to have as a built-in feature. However, you might be able to extract this info from the hidden main window (via View > Key History) if you need it.

I'll include this function in a hotkey interface script i'm working on, which will be posted soon hopefully, within a month. The info can be used for a TimersOn/Off toggle, on the note that CPU-intensive threads perform faster with no timers running.

ListView, Recursive-Sort feature retention of previous sort order for automatic nested sort effect.

Do you mean have newly-added rows automatically inserted into the correct positions based on the current sort order?

I mean after a user clicks a column heading, then a different column heading, the results would be sorted primarily by the second click operation, of which same items are sorted under the first operation. But nevermind, i double-checked, and this seems to already be the case, although i havent reviewed it for sets of hundreds of items. Could you verify whether the sort is already supposed to work this way?

fix [uninitialized] variables made in Function Loops to be default local.

Variables in a function should all be local by default. Can you clarify?

i was working on a wildcard function 3 months ago, but i put it on the shelf since I want to figure out a method for dynamic variables, without looking at jonny's script (yes, reinvent the wheel, for challenge). I'll review my script, which currently seems to grow the number of variables by the set number on every run. It may be a fault in the monitoring method i use during execution.

MDI/nested subcontrol support for the active applicatiion.

Better child window support is planned, but I've made a note to try to extend it to the commands you mentioned. Thanks.

It would greatly expand script ability for such things as browser control within a page layout, which could be very useful, i think. But i understand this feature is probably quite involved in coding.

Again, thanks for the response and evaluation, and staying the course for optimal code size and Helpfile readability.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I mean after a user clicks a [ListView] column heading, then a different column heading, the results would be sorted primarily by the second click operation, of which same items are sorted under the first operation. But nevermind, i double-checked, and this seems to already be the case, although i havent reviewed it for sets of hundreds of items. Could you verify whether the sort is already supposed to work this way?

AutoHotkey uses the built-in ListView sorting offered by the OS. There's a good chance that this sort offers the hierarchical behavior you describe on all platforms (however, I don't think it's documented at MSDN). If you find out more, please post here.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
Some more ideas:

1) fix ~ hotkeys to not pass thru BlockInput.
2) improve simulated alphanumeric input to conform to SetCapsLockState.
3) A_PrevMenuItemPos, previous position allows features such as Delete/Modify/Rename this item.
4) option to continue thread during thread-generated context menus.
5) Functions, support for declaration of var type (global, etc) during function execution. For variables not yet determined at loading of script, i.e., dynamic variables. I know this is already planned, but i just like mentioning it again since programs with dynamic parameters are much more flexible.
6) Sort, support for user-specified delimiters. Useful when not wanting to sort lines within array elements.
7) Functions, support for blank optional parameters in the middle of a set of optional params.
8) StringReplace, offset option.
9) StringReplace, replace all instances except first.
10) Run/RunWait, Target parameter support for ahk_pid. Allows use of file parameters with already open programs.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

1) fix ~ hotkeys to not pass thru BlockInput.

The program could be changed so that hook hotkeys (such as tilde) cannot fire while BlockInput is ON. However, that would break existing scripts that rely on the current behavior. Further comments are welcome from anyone.

2) improve simulated alphanumeric input to conform to SetCapsLockState.

Have you tried "SetStoreCapslockMode off"? If that is inadequate, there is a plan to have a SendBlind command to send keystrokes without changing the state of the modifier keys Ctrl/Shift/Win/Alt.

3) A_PrevMenuItemPos, previous position allows features such as Delete/Modify/Rename this item.

Do you mean for use with DllCall? If so, it might be a while in coming due to rarity of use. Perhaps you could use DllCall to derive the position of a menu item from its name.

4) option to continue thread during thread-generated context menus.

That might be difficult because TrackPopupMenu() is used internally, which ties up the script's thread. However, there is a plan to add a mode that allows new threads to launch while a menu is displayed. This might be a solution depending on what you needed it for.

6) Sort, support for user-specified delimiters. Useful when not wanting to sort lines within array elements.

I'm probably misunderstanding you, but a custom delimiter can already be specified via Sort's D option.

7) Functions, support for blank optional parameters in the middle of a set of optional params.

It's a good suggestion. The only reason it hasn't been done is that the repercussions of allowing empty parameters (two consecutive commas) are hard to evaluate.

8) StringReplace, offset option.
9) StringReplace, replace all instances except first.

These are good. I'll put them on the to-do list.

10) Run/RunWait, Target parameter support for ahk_pid. Allows use of file parameters with already open programs.

If that's possible, I've never heard of any way to do it. Perhaps someone else knows.

Thanks!

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

Pause support to disregard routine which invokes it, but to apply to previous thread.

Pause[, On|Off|Toggle, 0|1]  0=old method/default; 1= no effect on invoking routine

When working on the Pause command, I saw more clearly what you meant. In v1.0.37.06, I've added this parameter as you described. Please let me know if you have any problems with it.

Thanks for the suggestion.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
Sorry for the late reply; i had virtually sequestered myself until having made significant progress toward resolving the clipboardAll problems posed by Microsoft Word, since those (specific to MS Word users) factor into the usage of the Easy Input script, and as occasionally mentioned by Laszlo throughout the course of several months. Then i detoured for a couple weeks, focusing on a strategy game (and automating it in the process).

Thanks for implementing the new Pause parameter. The system as it is now, though at first sight may be confusing to some, is the most logical, as it operates according to thread execution stack rather than chronological order of having invoked Pause. In addition, Pause can now be applied in coding techniques beyond the single-line purpose of a simple Pause effect.

There is one minor problem which i found, which is that the Ahk tray menu, if customized, does not respond to right-click when Pause is in effect. This may also be the case for other custom menus. (Win2000)

--------------------

Here are 3 more ideas:

1) Menu, enhance Label-or-Submenu to Label-or-Submenu-or-Function

2) A_ThisLabel / A_ThisSubroutine, label of current subroutine,
allowing for integration/consolidation of similar subroutines.
Simplifies code thru bypassing check of multiple entry conditions.

3) Sort, improve Numeric sort to behave identically to Alphabetic, until a column with a number is encountered, upon which the sort is then done numerically, nested within alphabetic using that column.
var10 would be between var9 and var11, instead of random placement due to not being a number, and instead of between var1 and var2 as alpha sort would have it.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

i had virtually sequestered myself until having made significant progress toward resolving the clipboardAll problems posed by Microsoft Word

That's still a pretty high priority on the list, but some other things have come up that have delayed it.

the Ahk tray menu, if customized, does not respond to right-click when Pause is in effect.

I can't reproduce it, so it might be a script-specific issue. Here's a basic test script. Perhaps you could modify it or post your own short script to demonstrate the issue.

#Persistent
Menu, Tray, NoStandard
Menu, Tray, Add, Test, Test
Menu, Tray, Add, Exit, Exit
return

#space::
Pause,, 1  ; Toggle the pause state of the thread underneath.
return

Test:
MsgBox You selected %A_ThisMenuItem%.
return

Exit:
ExitApp

1) Menu, enhance Label-or-Submenu to Label-or-Submenu-or-Function

Although it might not happen due to code size reasons, I've made a note of it.

2) A_ThisLabel / A_ThisSubroutine, label of current subroutine, allowing for integration/consolidation of similar subroutines. Simplifies code thru bypassing check of multiple entry conditions.

I could use an example of what you would use this for because A_ThisHotkey, A_Gui/A_GuiControl, and A_ThisMenuItem are designed to meet most such needs.

3) Sort, improve Numeric sort... var10 would be between var9 and var11, instead of random placement...

That sounds good, much like the sorting paradigm introduced in Windows XP I think.

Thanks for the ideas.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004

the Ahk tray menu, if customized, does not respond to right-click when Pause is in effect.

I can't reproduce it, so it might be a script-specific issue.

I had forgotten to mention that the behavior existed prior to the adding of the new Pause parameter. To reproduce the effect, try the following (it might only be specific to Windows 2000):

1) customize the Ahk tray menu, keeping the standard items.
2) Reload the script (otherwise the behavior may be masked).
3) right-click the Ahk icon and select Pause Script from the custom menu.
4) If you right-click the Ahk icon again, the tray menu does not appear; however, one can unpause the script if Pause has been assigned to hotkey.

2) A_ThisLabel / A_ThisSubroutine, label of current subroutine, allowing for integration/consolidation of similar subroutines. Simplifies code thru bypassing check of multiple entry conditions.

I could use an example of what you would use this for because A_ThisHotkey, A_Gui/A_GuiControl, and A_ThisMenuItem are designed to meet most such needs.

While A_ThisHotkey, A_Gui/A_GuiControl, and A_ThisMenuItem are sufficient for most contingencies, consider the following: You have 3 different points in the script which call the same subroutine, except that the subroutine needs to execute only 1 or a few lines differently. Although this can already be done using If and checking various conditions, you could potentially be checking several if not many conditions, and such a check could be completely bypassed simply by differentiating which routine called the subroutine, using an alias of the subroutine:

CalledBy_A:
CalledBy_B:
CalledBy_C:
Subroutine:
...
return
And, thus, this coding technique requires A_ThisSubroutine / A_ThisLabel.

6) Sort, support for user-specified delimiters. Useful when not wanting to sort lines within array elements.

I'm probably misunderstanding you, but a custom delimiter can already be specified via Sort's D option.

This is true, and i had missed to initially read the Sort section on it. Upon closer inspection, i noticed that the delimiter is limited to only one character. Although this is sufficient for most tasks, there is the possibility that the user is handling a sufficient number of non-standard characters which would effectively negate the adequacy of a one-char delimiter. Also, i noted that #CommentFlag and Join (for line continuation) each accept parameters up to 15 characters in length, so i figured perhaps the Sort user-delimiter could be more than 1 char also.

Thanks again.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

While A_ThisHotkey, A_Gui/A_GuiControl, and A_ThisMenuItem are sufficient for most contingencies, consider the following: You have 3 different points in the script which call the same subroutine, except that the subroutine needs to execute only 1 or a few lines differently. Although this can already be done using If and checking various conditions, you could potentially be checking several if not many conditions, and such a check could be completely bypassed simply by differentiating which routine called the subroutine, using an alias of the subroutine:

CalledBy_A:
CalledBy_B:
CalledBy_C:
Subroutine:
...
return
And, thus, this coding technique requires A_ThisSubroutine / A_ThisLabel.


Why not create these global variables in the code? Just before jumping to the common section of code assign a variable the value of the section that it was just in... Maybe I'm misunderstanding...