et cetera Posted August 19, 2016 Report Share Posted August 19, 2016 (edited) Hi, all, Newbie here. I just made my first Macro Express macro, and it works. I set the time to playback at 4x the original speed, but it's still slower than I'd like and than I think it could be. I'm wondering if there's a good, quick way to change all the delays in the script in one fell swoop (bulk replace). The delays range from ~1000ms to ~7500ms. Maybe the only option would be to edit it in text editor and then re-import it after using some regular expression, but I'd like to avoid that, since I am not good with that stuff. My thought was that I'd change all the delays to 500ms and see if it still works. If not, raise them up to, say, 1000, and try again until I get it as fast as I can. Another thought is to just take all the delay commands out of the macro and see if it still works, but I rather doubt it would. Any advice is welcome. Eric Edit: Macro Express 3.1b Build 1 (3.10.2.1) on a VirtualBox VM running Windows 10 Version 1511 (Build 10586.545). Edited August 19, 2016 by et cetera Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 19, 2016 Report Share Posted August 19, 2016 The 'Macro Playback Speed' has the effect of adjusting all the delays in your macro. Entering 0.1 in the 'Playback Factor:' has the effect of speeding up the macro by 10 times. All delays of 500ms run at 50ms. You could do a bulk replace in the Direct Editor. Do this to change all 'Delay 10 Milliseconds' command to 'Delay 1 Milliseconds': Click the Direct Editor button Click at the beginning of the macro Press Ctrl+R to bring up the Find/Replace dialog Enter <MSD:0010> in the 'Find what:' field Enter <MSD:0001> in the 'Replace with:' field Click the Replace All button To remove all 10ms delays search for '<MSD:0010><' and replace it with '<'. When I create a macro that I am going to use more that a few times I spend some time to optimize it. One thing that I do is to use variables for the delays. Variable Set Decimal %D1% to 0.025 Variable Set Decimal %D2% to 0.1 Variable Set Decimal %D3% to 1.0 // Some macro commands // Short delay Delay %D1% Seconds // Some more macro commands // Medium delay Delay %D2% Seconds // Even macro commands // Long delay Delay %D3% Seconds Then, if I need to change the delays I only need to change them at the top of the macro. Quote Link to comment Share on other sites More sharing options...
rberq Posted August 19, 2016 Report Share Posted August 19, 2016 It sounds like you captured the macro rather than coded it from scratch. Usually when I do that, I wind up with delays that incorporate my thinking time and floundering-around time, which have little to do with the delays REALLY needed when the macro runs. You could use Samrae's Direct Editor approach to change all the delays to something extremely short, like 1ms. But don't delete them yet, because it will be handy to know where they are within the macro. Then, with the script editor test the macro a bit at a time by inserting temporary Macro Return statements and adjusting the delays to realistic values wherever you find they are truly needed. I have never bothered with the macro speed factor because I find it easier to work in terms of real time. Also, the sad fact is that when a macro really requires a delay, it will usually fail occasionally because Windows is busy doing some odd thing or other, and doesn't respond as fast as usual. So if it's a critical macro, you wind up making the delays extra long to allow for that once-in-a-blue-moon slow response. Or, you use some other method to tell when the macro can continue with its next steps. Quote Link to comment Share on other sites More sharing options...
et cetera Posted August 21, 2016 Author Report Share Posted August 21, 2016 Samrae & rberq, Thanks, both of you, for the responses. I do see now how to do what I wanted to. rberq, yes it was a captured macro, not coded from scratch. I'll see how it goes when I make changes. Thanks, Eric 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.