Mouse And Keyboard Macro Recorder v4.5

Post your working scripts, libraries and tools
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Macro Record of Mouse and Keyboard v2.5

17 Jul 2017, 07:05

I updated the script to v2.5, It can be edited in the middle of the recording,
but it also increases the difficulty of beginners. :D

Because my English is not very good, so some sentences I understand are difficult,
my replies are using automatic translation, there must be a lot of inaccurate expression and grammatical errors, I'm sorry.

You master, if you have good ideas, please work together to improve. :bravo:
CAH9t
Posts: 28
Joined: 15 Jul 2017, 11:12
Location: Land

Re: Macro Record of Mouse and Keyboard v2.5

19 Jul 2017, 08:57

You weren't spending time in vain I must say.
1) I absolutely love suspend feature with built-in editor.
2) WinWait(tt, tx="") is a great idea to simplify and shorten the code
3) Mouse coordinates is nice addition
4) If you don't mind my asking, what is your native language, maybe we've got the same? You may send it via private message if you don't want to disclose it.

5) What is it you didn't understand from my previous big post (cause as I see it is a plenty)? Don't be shy to ask. I'll try to be more «automatic translation compatible».

6) Could you look again at least in that peace to give me clue about what I should change in your code to get the desirable effect (I've changed it a bit to clarify) ?

Is it possible to Exclude from the list of scancoded keys all non-language dependable keys (just like you did with LRwin shift ctrl alt they're fine). Those keys are now scancodes in my edition of your script (and that is no good) capslockScrLockNumlck,printscreen,tab,escape,enter, space backspace, insertDel, EndHome pgUpDn , rightLeftUpDown arrows ,appkey, f1-f12, all numpadKeys) ? More so As for the numpad keys they aren't working properly via scancodes at all, acting like numlock is off (you're getting Numinsert NumDel NumEnd NumHome and so on instead of figures - 0 . 1 7 ).


PS. I'm sorry I'm a bit slow with my answers. Sometimes I have a lot on my plate (in that place should've been a joke, but automatic wouldn't digest it :shh: ).
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Macro Record of Mouse and Keyboard v2.6

19 Jul 2017, 13:45

@CAH9t
Hello, thank you very much for your advice on using SC to record keyboard actions. :thumbup:
I haven't tried input from other countries before,
Therefore, I do not know the keyboard layout of different countries
Entering the same key may produce different characters.
Now I updated the script to v2.6, this problem should be fixed.
Also, I'm from China. I'm glad that the website has a Chinese forum. :xmas:
CAH9t
Posts: 28
Joined: 15 Jul 2017, 11:12
Location: Land

Re: Macro Record of Mouse and Keyboard v2.7

21 Jul 2017, 08:44

Hi. You're welcome.
Hell of a job, my friend. Pity I've already figured the scancode-problem for my layout in v2.5, wasn't that hard to bother you with that, and you've already gave me all necessary info for the solution.
1. Nice mouse info section on ctrl.
2. I see you've already fixed«Volume_DownVolume_MuteVolume_Up» problem from v2.5

3. It will be a great addition to have «MouseClick , L\RButton , X, Y, 1, , , R» with R-parameter for clicking context menu items anywhere you want. It's rather popular option in macro recorders by the way.
4. «CoordMode, Mouse, Window» is generally more reliable than «CoordMode, Mouse, Screen». Unless of course you have something special on your mind, I would recommend to set «CoordMode, Mouse, Window» by default and «CoordMode, Mouse, Screen» on checkbox.
5. ControlClick is recording only coordinates not buttons, is it ok?
6. It could be useful to add closing action on "Guiclose:". "WinMinimize, ahk_id %gui_id%" you can achieve via Esc hotkey in #if guiWindow, whick is more comfortable. Also like an option, you may add another button for closing the app.
7. points 4. and 6. are just thoughts. It's easy to adapt them manually.
8. I think the most convenient way of calling the gui is one of your earlier solutions when you're touching with a cursor «x=0 y=0-100» area . «x=0 y=0» is not as responsive by far and it's often used by other scripts.

Best wishes.
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Macro Record for Mouse and Keyboard v2.9

23 Jul 2017, 15:44

@CAH9t, Thank you for your advice. :angel:
I updated the script, some adjustments were made for 4, 6, and 8.
For advice 3, I think that moving relative to the mouse position
is easily affected by user actions, and playback is not accurate enough.

In addition, the ControlClick coordinate mode will automatically
find the control at the coordinates, very convenient,
and click on the location is more accurate.
If it uses the class name of the control, it clicks in the center of the control,
and if the program is updated, the class name may be changed.
CAH9t
Posts: 28
Joined: 15 Jul 2017, 11:12
Location: Land

Re: Macro Record for Mouse and Keyboard v2.9

26 Jul 2017, 07:03

Thank you, for your great and ingenious coding 8-)
#8 really is a nice system for quick stops and resuming.«»
On ctrlclick - OK, I've got your point.

For the 3rd advice, what I really head in mind was the following system (correct me if I'm wrong, pretty fail-safe)
Here's a flow chart:
You hold capslock and system records x1 y1 current mouse coordinates
You make a click anywhere else and system records x2 y2 end coordinates.
You Release capslock and ahk adds another string where «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R»

As you know «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R» =«MouseClick , L\RButton , x2, y2, 1, , , » but it may come in handy if You would need to change manually the original coordinates x1=x1` and y1=y1` for some reason. That is «MouseClick , L\RButton , x2, y2, 1, , ,» but «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R» is still correct .

capslock cause it's being held really rare ( in a way of user activity ) .
It could be a convenient tool for more advanced users, when you need to call context menu from anywhere, for example, As a part of the bigger script to add. Sometimes it's really tedious to calculate relative coordinates. So my point is that would be a useful tool, not means of improving overall reliability.
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Macro Record for Mouse and Keyboard v2.9

26 Jul 2017, 14:55

CAH9t wrote:Thank you, for your great and ingenious coding 8-)
#8 really is a nice system for quick stops and resuming.«»
On ctrlclick - OK, I've got your point.

For the 3rd advice, what I really head in mind was the following system (correct me if I'm wrong, pretty fail-safe)
Here's a flow chart:
You hold capslock and system records x1 y1 current mouse coordinates
You make a click anywhere else and system records x2 y2 end coordinates.
You Release capslock and ahk adds another string where «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R»

As you know «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R» =«MouseClick , L\RButton , x2, y2, 1, , , » but it may come in handy if You would need to change manually the original coordinates x1=x1` and y1=y1` for some reason. That is «MouseClick , L\RButton , x2, y2, 1, , ,» but «MouseClick , L\RButton , X=x2-x1, Y=y2-y1, 1, , , R» is still correct .

capslock cause it's being held really rare ( in a way of user activity ) .
It could be a convenient tool for more advanced users, when you need to call context menu from anywhere, for example, As a part of the bigger script to add. Sometimes it's really tedious to calculate relative coordinates. So my point is that would be a useful tool, not means of improving overall reliability.


Hello. FYI: To write code in a sentence use [c]your code here[/c​]. Your posts are very difficult to read at the moment...

I'm not sure I understand what your 'caps lock' request is personally, and I don't really see the point in it either I'm afraid... Maybe you would be better off with picture search instead? Granted, adding picture search to the macro recorder would be ace! Sometimes you just can't automate applications because they have no positional data. So using picture search could be really really useful for a macro recorder!

It could be a convenient tool for more advanced users, when you need to call context menu from anywhere


Oh do you mean a 'click-relative to the last clicked location'? That is a feature already is it not?
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Macro Record for Mouse and Keyboard v3.0

27 Jul 2017, 00:01

I updated the script to v3.0, the actual delay is no longer recorded,
and the function of the Ctrl key generation code is enhanced.
However, this also increases the difficulty of novices' use. :D
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Macro Record for Mouse and Keyboard v3.0

27 Jul 2017, 12:26

Made some time to test the macro recorder.

I didn't know you already added image searching. But how exactly do you use the image search?

Press Control > Hover over image search button > Press Control > "now what???"


**EDIT:**

Oh you don't... (Looking at the code now). Although this might be fixable with GDI+ :D
CAH9t
Posts: 28
Joined: 15 Jul 2017, 11:12
Location: Land

Re: Macro Record for Mouse and Keyboard v3.0

29 Jul 2017, 06:57

sancarn, As I see you've already got the point about relative clicks ( I really tried to make it obvious as hell ) ? it's not at all a rare feature in macro recorders.
I gave a flow chart, not the real code , in my book there would be a confusion if I'd brace it into code brackets. Do you have blocks for the due flow chart, here? And I don't see any use in coding single simple commands like to make them look cool, so I won't :angel: .

ps. By the way, you could use to read the stuff more attentively.
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Mouse And Keyboard Macro Recorder v3.0

01 Aug 2017, 12:18

@feiyue

You might want to implement this feature into your macro recorder. My vision is the following:

    1. You click on 'Insert an image search command'
    2. The user selects a portion of the screen representing the picture.
    3. The picture is saved and the filepath is included in the image search command in the macro recorder section.
    ------
    4. When the 'project' is saved, the pictures are also moved so they are relative to the ahk script that was saved. And the paths within the script would also require altering.

Anyway, I have written some code implementing the screenshot system. Try pressing Win+S while running this script. P.S. When you draw the screenshot rectangle, a red rectangle should also appear around the section you are screenshotting.

By looking at the code you can see that I, to take the screenshot, only have to do:

Code: [Select all] [Download] GeSHi © Codebox Plus

GoSub, TAKE_A_SCREENSHOT


I will leave the code generation and such up to you though :)
RoyBlumenthal

Re: Mouse And Keyboard Macro Recorder v3.0

02 Aug 2017, 09:12

Hi Guys...

I'm really sorry that I'm being so ignorant! I simply haven't got a clue how to use this script!

I've saved the file as an AHK extension. I double click on it. And it seems to run the script, cos I see a little "H" logo in my "show hidden icons" window in the taskbar. But nothing seems to be happening.

This is what I'm actually trying to achieve...

1. I use a keyboard shortcut in PHOTOSHOP: SHIFT-CONTROL-ALT-N. This creates a new layer above the one I'm working on.

2. On my previous machine, a Wacom Cintiq Companion 2, I was able to assign that keyboard shortcut string to a hotkey on the device. My machine is in for repair. And Wacom has loaned me a newer machine, the Wacom Studio Pro. In this machine, it simply will not accept the SHIFT part of the keyboard shortcut. All I want is to be able to assign that string to the hotkey.

Is this script the right thing for me to be attempting to use? Is there a better way of doing it?

3. I have a second keyboard shortcut that also needs assigning to one of the hot buttons on the device... SHIFT-CONTROL-ALT-N CONTROL-] CONTROL-]. This basically makes a new layer above the one I'm on, then moves it down twice in the layer stack. Effectively making a new layer BELOW the one I'm on.

Thanks for any help that may come from my ignorant plea!

Blue skies
Roy
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Mouse And Keyboard Macro Recorder v3.0

02 Aug 2017, 14:34

RoyBlumenthal wrote:Hi Guys...

I'm really sorry that I'm being so ignorant! I simply haven't got a clue how to use this script!

I've saved the file as an AHK extension. I double click on it. And it seems to run the script, cos I see a little "H" logo in my "show hidden icons" window in the taskbar. But nothing seems to be happening.

This is what I'm actually trying to achieve...

1. I use a keyboard shortcut in PHOTOSHOP: SHIFT-CONTROL-ALT-N. This creates a new layer above the one I'm working on.

2. On my previous machine, a Wacom Cintiq Companion 2, I was able to assign that keyboard shortcut string to a hotkey on the device. My machine is in for repair. And Wacom has loaned me a newer machine, the Wacom Studio Pro. In this machine, it simply will not accept the SHIFT part of the keyboard shortcut. All I want is to be able to assign that string to the hotkey.

Is this script the right thing for me to be attempting to use? Is there a better way of doing it?

3. I have a second keyboard shortcut that also needs assigning to one of the hot buttons on the device... SHIFT-CONTROL-ALT-N CONTROL-] CONTROL-]. This basically makes a new layer above the one I'm on, then moves it down twice in the layer stack. Effectively making a new layer BELOW the one I'm on.

Thanks for any help that may come from my ignorant plea!

Blue skies
Roy


Hi Roy,

Yeah I too was a bit confused when starting up the application because I didn't see anything happenning.

You need to move your mouse to the far left hand side of the screen to see the GUI (Graphical User Interface)

Is this script the right thing for me to be attempting to use? Is there a better way of doing it?


No. This script will not help you here really. Remapping keys is something you should just know

As for #3, try:

Code: [Select all] [Download] GeSHi © Codebox Plus

Create_New_Layer:
Send,^+!N
Send,^]
Send,^]
return
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Mouse And Keyboard Macro Recorder v3.0

02 Aug 2017, 23:59

This tool is just for beginners to automatically generate code, for the master, it may not have much effect. :D
Another tool I release, FindText(), is a very good tool for writing automated scripts,
which implements the search for images and text, and does not generate additional picture files.
It's good for a master.
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Mouse And Keyboard Macro Recorder v3.0

03 Aug 2017, 01:33

feiyue wrote:This tool is just for beginners to automatically generate code, for the master, it may not have much effect. :D.


What? And the beginner will easily be able to program the image search? I think it's much easier for a noob to figure out how prewritten code is working than have to write code themselves, but whatever floats your boat. It's alright if you have a different opinion, but the way I see it is the more you add, the easier it is for a noob to write their own complicated scripts. That's just my opinion though.
feiyue
Posts: 53
Joined: 08 Aug 2014, 04:08

Re: Mouse And Keyboard Macro Recorder v3.5

03 Aug 2017, 17:35

I updated the script to v3.5, added a lot of code. :D
Now it can automatically generate ImageSearch code and Coordinate relative image origin code.
Additionally, the Debug button is added to the GUI interface to debug stuck rows.
User avatar
Relayer
Posts: 101
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: Mouse And Keyboard Macro Recorder v3.5

04 Aug 2017, 09:37

A couple of suggestions:

I find that I want to save macros for future use. I name my macros with the extension ".ahm". It would be nice if your program had an open/save/saveas feature for creating/using/editing macros. The user could name therm whatever they wanted. The user can associate the .ahm with the AutoHotkey exe so the macro can run on double click.

Another nice feature is to add an edit box so the user can input the number of loops to execute instead of needing to interrupt an infinite loop.

You may want to consider forking your design to keep a much simpler macro-maker for those that do not need the complexity that goes along with dealing with images. An image-capable version could be the second version. Simplicity, for most people, will minimize the number of 'second order' problems that might cause people to stop using the tool.

Here is your V3.0 with my embellishments. BTW, I tend to want to convert your Goto statements to Gosub and indent with tabs instead of spaces. Just preference.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Relayer
User avatar
SpeedMaster
Posts: 78
Joined: 12 Nov 2016, 16:09

Re: Mouse And Keyboard Macro Recorder v3.5

04 Aug 2017, 14:23

Hello,
I updated my previous post with the new Unofficial Macro Record (v2.0)
New features: 8-)
Ini file
Internal editor with menu
backup file
possibility to record as VkSc code
Repeat with counter
compatibility with AutoScriptWriter II - ( by Larry Keys )

Feel free to comment... :wave:
sancarn
Posts: 186
Joined: 01 Mar 2016, 14:52

Re: Mouse And Keyboard Macro Recorder v3.5

06 Aug 2017, 12:40

Relayer wrote:I name my macros with the extension ".ahm".


Why would you name the macros with their own special extension? To me this feels a bit pointless (unless you are storing extra data)... Especially when an AHK file can be saved and opened in the same manner as any other file (with this program). To me, this will just confuse people.

Relayer wrote:Another nice feature is to add an edit box so the user can input the number of loops to execute instead of needing to interrupt an infinite loop.


Perhaps a conditional break.
User avatar
SpeedMaster
Posts: 78
Joined: 12 Nov 2016, 16:09

Re: Mouse And Keyboard Macro Recorder v3.5

07 Aug 2017, 18:04

feiyue wrote:Another tool I release, FindText(), is a very good tool for writing automated scripts, which implements the search for images and text, and does not generate additional picture files.


Hello,
I updated my previous post with the new Unofficial Macro Recorder (v3.0)
New feature: 8-)
Embedded picture find tool : Findtext v5.2 (by Feiyue)

The unofficial version is only experimental but I hope that the find text tool will be also incorporated in the official version. :thumbup:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 14 guests