Search found 677 matches

by Dorian (MJT support)
Thu Jun 18, 2020 9:54 am
Forum: Technical / Scripting
Topic: Why Run> doesn't work like Start, Run?
Replies: 4
Views: 249

Re: Why Run> doesn't work like Start, Run?

Here you go. I usually use /C when I want the window to close afterwards, and /K if I want it to stay open. This is useful if things aren't going as expected. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>cmd /? Starts a new instance of the Windows XP command in...
by Dorian (MJT support)
Wed Jun 17, 2020 12:19 pm
Forum: Technical / Scripting
Topic: Macro mouse
Replies: 1
Views: 102

Re: Macro mouse

Wait time can be as low as 1 millisecond : Timer>start Wait>0.001 Timer>end Let>milliseconds=end-start MessageModal>Milliseconds elapsed: %milliseconds% *Naturally you'll get a different result each time you run it as this is entirely dependent on what the system is doing because of course this is m...
by Dorian (MJT support)
Wed Jun 17, 2020 12:01 pm
Forum: Technical / Scripting
Topic: Why Run> doesn't work like Start, Run?
Replies: 4
Views: 249

Re: Why Run> doesn't work like Start, Run?

The problem isn't RunProgram, it's the strFFmpeg you're creating. There's a few things missing. Let's get back to basics. Here's an example of some working RunProgram ffmpeg code which creates a 3 second clip. RunProgram>CMD /c c:\ffmpeg\bin\ffmpeg.exe -ss 00:00:0 -i c:\ffmpeg\bin\fs18.mp4 -t 00:00:...
by Dorian (MJT support)
Mon Jun 15, 2020 9:40 am
Forum: Technical / Scripting
Topic: How to repeat this code until there is no more same image
Replies: 1
Views: 109

Re: How to repeat this code until there is no more same image

You can do that with While / EndWhile , so the code will keep looping until a certain condition is met. If the image is visible and found by FindImagePos, NumFound will be 1. So we can keep looping until it is no longer 1. Note that we set NumFound to 1 before the While/Endwhile loop to ensure the c...
by Dorian (MJT support)
Thu Jun 11, 2020 5:19 pm
Forum: Technical / Scripting
Topic: FindImagePos not staying within the WINDOW given
Replies: 1
Views: 113

Re: FindImagePos not staying within the WINDOW given

If it doesn't find the window it searches the entire screen. I'm wondering if it could be one of these : 1: The window is not visible, cannot be captured and so you're getting a false positive. Try setting focus. 2: The window you're getting a false positive in is on top of the one you want. 3: The ...
by Dorian (MJT support)
Wed Jun 03, 2020 10:00 am
Forum: Scripts and Tips
Topic: Combining scripts
Replies: 1
Views: 209

Re: Combining scripts

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 Pr...
by Dorian (MJT support)
Fri May 15, 2020 9:09 am
Forum: Technical / Scripting
Topic: I'm new and I need a little help...
Replies: 3
Views: 321

Re: I'm new and I need a little help...

Always happy to help, and thank you for your kind comments.
by Dorian (MJT support)
Fri May 15, 2020 9:05 am
Forum: Technical / Scripting
Topic: Pick a random action?
Replies: 4
Views: 309

Re: Pick a random action?

I replied to your PMs but there's no inherent reason we need to be discussing this privately as no sensitive information is involved. So let's continue here. The same rule applies. MessageModal was just to demonstrate how to do what you asked. That's where you put your code for each action. Use the ...
by Dorian (MJT support)
Thu May 14, 2020 5:11 pm
Forum: Technical / Scripting
Topic: Pick a random action?
Replies: 4
Views: 309

Re: Pick a random action?

Yes, for that we can use a combination of Random and SRT (subroutines). //Generate a random number Random>5,Result Let>Result=Result+1 //Call SubroutineNumber gosub>routine%Result% srt>routine1 messagemodal>1 END>routine1 srt>routine2 messagemodal>2 END>routine2 srt>routine3 messagemodal>3 END>routi...
by Dorian (MJT support)
Thu May 14, 2020 8:56 am
Forum: Technical / Scripting
Topic: I'm new and I need a little help...
Replies: 3
Views: 321

Re: I'm new and I need a little help...

Hopefully this will be on the right track and give you some ideas. If you're using the Image Recognition Wizard to generate FindImagePos IR code, you'll see something like this : FindImagePos>%BMP_DIR%\image_1.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF If>NumFound>0 MouseMove>XArr_0,YArr_0 LClick En...
by Dorian (MJT support)
Wed May 13, 2020 10:47 am
Forum: Technical / Scripting
Topic: Fighting the endless loop
Replies: 4
Views: 298

Re: Fighting the endless loop

That's the question - if it is in an actual loop, you can use methods similar to mine to exit. If it isn't an actual loop and is simply stuck on a line of code, then it's best we find out why. Do you have any WaitWindowOpen lines that may be stalling it? That's quite a common occurrence and can ofte...
by Dorian (MJT support)
Tue May 12, 2020 5:00 pm
Forum: Technical / Scripting
Topic: Fighting the endless loop
Replies: 4
Views: 298

Re: Fighting the endless loop

If it is actually looping you could try counting how many times it's looping, and exit if it reaches X times. If Let>loopcount=1 ..beginning of pseudo loop if>loopcount>10 exit / or call another macro Endif ..end of pseudo loop If it's time based, you can do the same thing based on elapsed seconds. ...
by Dorian (MJT support)
Tue May 12, 2020 2:09 pm
Forum: Technical / Scripting
Topic: Script fails in ver 15 but works in 14
Replies: 7
Views: 475

Re: Script fails in ver 15 but works in 14

That's great to hear!
by Dorian (MJT support)
Tue May 12, 2020 9:29 am
Forum: Technical / Scripting
Topic: Script fails in ver 15 but works in 14
Replies: 7
Views: 475

Re: Script fails in ver 15 but works in 14

Email sent to support at MJTnet.com is only ever seen by Marcus and I, so feel free to do that.
by Dorian (MJT support)
Mon May 11, 2020 2:58 pm
Forum: Technical / Scripting
Topic: Screen capture capturing wrong area
Replies: 1
Views: 198

Re: Screen capture capturing wrong area

I was able to recreate this issue by connecting/disconnecting monitors without rebooting Macro Scheduler. I assume your resolution settings haven't changed, which could cause this. Of course you can always edit the coordinates in your script to reflect the correct area. One thing to consider when us...
Sign up to our newsletter for free automation tips, tricks & discounts