Nate Posted August 17, 2022 Report Share Posted August 17, 2022 Good Afternoon everyone, I'm new to the macro creation process, and I'm hoping to get some assistance with a macro i'm trying to build. I need to find a way that the macro can be built with keystrokes, and part of the macro needs to push CONTROL and the key S at the same time (ie to save the event). If at all possible, I want the entire macro to be keystrokes, and I am struggling to find any info on how to do this. I hope someone can point me in the right direction here. Thanks, Nate Quote Link to comment Share on other sites More sharing options...
Cory Posted August 17, 2022 Report Share Posted August 17, 2022 You're on the right track. Many people start with recording mouse movements and such, but it's better to write it from scratch and use as many keyboard shortcuts as possible. Text Type command under Keyboard is what to use. Most keystrokes are simply a matter of entering them in the script, but some are "chords" where multiple are done at once. Having said that, the alternate mode keys actually modify what is sent to the PC. For ones like Ctrl+S it is as simple as putting those in there. MEP is smart enough to know to essentially hold the ctrl key <CONTROL> down for yoru next keystroke. But if you ever need to do multiple keystroked modified, you need to use the <CTRLD><CTRLU> around those keys. Quote Link to comment Share on other sites More sharing options...
Nate Posted August 17, 2022 Author Report Share Posted August 17, 2022 Cory, You got me past a roadblock that would have been very difficult for me to figure out on my own. That was exactly the answer I needed and I'm able to continue building my script. Thank you very much. Nate Quote Link to comment Share on other sites More sharing options...
Cory Posted August 17, 2022 Report Share Posted August 17, 2022 You're welcome. Quote Link to comment Share on other sites More sharing options...
acantor Posted August 18, 2022 Report Share Posted August 18, 2022 If you hang around this forum long enough, you will start to notice two factions: those who insist that this is the best way: Text Type (Simulate Keystrokes): <CTRLD>s<CTRLU> And those who say this approach is fine: Text Type (Simulate Keystrokes): <CONTROL>s The truth (as I see it, anyways!) is that both approaches have a place. The former is probably more reliable than the latter. However, when the latter works, it seems to be equally reliable. Personally, I favour the second technique because I find the code a little easier to read. But if the macro fails with that line of code, I switch to the first technique. For the kinds of macros that I build, the second approach works for me 95% of the time. But people who use Macro Express for different purposes than I do might be right that the first approach is superior. Quote Link to comment Share on other sites More sharing options...
Nate Posted August 18, 2022 Author Report Share Posted August 18, 2022 Thank you @acantor I definitely expect to hang around the forum a lot. In this particular instance typing <CONTROL>s actually resulted in the script hitting control and then typing the letter s. For this particular project, it’s going to work best if I allow a delay because it’s data lines going into a system. The CTRLD CTRLU absolutely worked perfectly but I will keep exploring the capabilities of the software. Quote Link to comment Share on other sites More sharing options...
michaelkenward Posted August 23, 2022 Report Share Posted August 23, 2022 On 8/18/2022 at 1:33 AM, acantor said: The truth (as I see it, anyways!) is that both approaches have a place. The former is probably more reliable than the latter. However, when the latter works, it seems to be equally reliable. Excellent advice. The right one for you might depend on where you want to deploy keystrokes (target software), and the exact combination of control keys. The target software may have a mind of its own. Software writers also have a habit of changing how they go about things. There may also be several different keyboard strokes of achieving the same result. With or without using menus for example. The important thing is to remember that both options exist. If one approach doesn't work, try the other one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.