I'm an AHK user with no real computer programming background or education (I suppose Excel would be the closest thing I have to such knowledge/experience, excluding day-1 hello, world
exposure here and there, or cmd
/ VB6 waaay back in the day). For lots of my day-to-day tasks and workflows, I've adopted the use of AHK, but the manner I'm utilizing the scripts have always been input-literal; in other words, predominantly just emulated keystroke inputs that produce specific, superficial key input sequences.
In a sense, this works out in that I can utilize AHK with little to no learning curve -- among other such conveniences -- but there are obviously cons that come hand in hand with the pros. As such, I've become curious lately as to whether AHK is capable of directly interfacing and invoking actions specific to programs?
Conceptual Example
Let's take Notepad++, for example (we'll pretend it doesn't have any native functionality to achieve this, for the example's sake). I want to setup a hotkey to Copy, Cut and Paste Binary Content. How -- if at all possible -- should I approach creating the script?
Conjectural Concept
As part of my cursory information gathering, I did try running psr.exe
to see if I might be able to capture any useful information. Unfortunately, I'm not knowledgeable enough to make any use of the results, but I was thinking there might be some method similar to capturing what's happening on the backend in the same way that one might use the keyboard hook
to possibly capture non-standard key inputs. I've hosted the resultant data here, in case that can be utilized.
EDIT: To clarify any confusion, I am not referring to the conditional specificity in regards to the triggering conditions for a script (e.g., #winactive
). It's a bit difficult to describe any further than I already have without causing more confusion and causing this to get too convoluted I think, but if I have to give an analogous example, then what I want to achieve can be loosely compared to executing a program with specific arguments example.exe -function -parameter
as opposed to automating the process of running example.exe
followed by pre-determined keystrokes to navigate to said example function Alt + F, F, P
through the UI.
EDIT #2: Alright, apparently I'm still not properly conveying the meaning of my question. I'll make one more attempt before I give up on this.
Sample Objective:
- Create hotkey that invokes this function:
- The way I would currently do it:
- Assign hotkey which triggers a
send
input sequenceAlt + E, P, P, C, Enter
- Assign hotkey which triggers a
- The way I want to do it:
- Assign hotkey which directly calls on the
Copy Binary Content
function.
- Assign hotkey which directly calls on the
- Challenges: identifying which AHK function achieves this (e.g.,
DllCall
?), and enumerating the function's correct and available identifier/arguments - Using PSR.exe logs the following actions:
...Step 1: User left click on "Edit (menu item)" in "*ne" Program: NOTEPAD++.EXE UI Elements: Edit, Application, *new 1 - Notepad++ [Administrator], Notepad++
Step 2: User left click on "Copy Binary Content (menu item)" Program: NOTEPAD++.EXE UI Elements: Copy Binary Content, Paste Special, #32768, *new 1 - Notepad++ [Administrator], Notepad++...
Notice the "#32768"! Is there a way to directly call on that function?