Combining scripts

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
Mitch
Newbie
Posts: 9
Joined: Wed Apr 22, 2020 9:13 pm

Combining scripts

Post by Mitch » Tue Jun 02, 2020 5:49 pm

I'm starting to write smaller scripts and then call them from another script.

The hurdle I'm running into is the scripts often have issues when ran in sequence despite the fact they run cleanly individually. My assumption is that my script is still holding down Alt or Shift or something goofy and as the next script is called, its conflicting with the commands from the last one.

Currently I'm calling them all through the Macro> command.

1. Is there a decent way to check if I have buttons being pressed or other commands "hanging" from a previous script?

2. Is there a cleanup command that clears out all previous tasks from the other scripts?

Thanks in advance for the help or suggestions.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Combining scripts

Post by Dorian (MJT support) » Wed Jun 03, 2020 10:00 am

I think there could be a few things at play here.

Yes, you may not be releasing your modifier keys with Release. That link also shows you which keys can or should be released. A good indication of this is if any text sent has it's case reversed. Shift is still pressed.

So make sure each relevant Press has a corresponding Release. You could even put these in front of your Macro commands to help you see if this is the issue.

For example, if this fixes your problem, you know your last script left something pressed :

Code: Select all

Release Alt
Release Shift
Release Ctrl
Macro>d:\path\to\macro.scp
Other aspects to investigate are timing and focus. Are you sure you don't need to add a little Wait inbetween calling each macro? Are you sure each macro will have the focus it needs?

If you were using Include, variables could be carried over and may somehow be interfering with each other, but you're using Macro, so we can rule that out.

But if your hunch is that modifier keys are still pressed, that's the first place to look.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts