Search found 1356 matches
- Sat Sep 02, 2023 8:29 am
- Forum: Beginners
- Topic: If function understanding
- Replies: 8
- Views: 23462
Re: If function understanding
What you want to do is quite complex for a beginner. You'll need to master and fully understand the techniques linked below before you should even think about putting it all together into something resembling your "end product". Learn and test each stage/element. Make sure you can walk before you tr...
- Fri Sep 01, 2023 5:02 pm
- Forum: Beginners
- Topic: If function understanding
- Replies: 8
- Views: 23462
Re: If function understanding
You know.... I don't think I've ever used that in the 25 years I've been using MS (IfNot probably hasn't existed for 25 years)...
In fact it slipped my mind that it even existed.
In fact it slipped my mind that it even existed.
- Fri Sep 01, 2023 12:51 pm
- Forum: Beginners
- Topic: If function understanding
- Replies: 8
- Views: 23462
Re: If function understanding
To compare two variables and exit the script if they are not the same, you'd do something like this :
You can see an in-depth description of IF here.
Code: Select all
if>%variable1%<>%variable2%
exit
endif
- Tue Aug 29, 2023 4:50 pm
- Forum: Technical / Scripting
- Topic: Sending commands to serial port
- Replies: 1
- Views: 6221
- Tue Aug 22, 2023 3:47 pm
- Forum: Technical / Scripting
- Topic: how to boilerplate macros
- Replies: 5
- Views: 8285
Re: how to boilerplate macros
You have the OnEvent in an endless loop which doesn't seem like a good idea as you only need that to run once. It didn't work for me either so I changed it so it will look for ., then move on to look for the h, then the i. tbh this approach doesn't make much sense to me as I have a feeling it could ...
- Tue Aug 22, 2023 10:07 am
- Forum: Technical / Scripting
- Topic: how to boilerplate macros
- Replies: 5
- Views: 8285
Re: how to boilerplate macros
I hope I'm understanding correctly. I think it would be difficult to cover all eventualities, but maybe something like this with all your commonly typed sentences. These are the kind of script that tend to grow in time... ..and of course you could even write it to present a different set of options ...
- Mon Aug 21, 2023 7:19 pm
- Forum: Technical / Scripting
- Topic: select todays dated image
- Replies: 3
- Views: 6985
Re: select todays dated image
If you want to start with 08/21/2023 and end up with 08212023.jpg, you can simply use StringReplace to replace the "/" with "nothing", then add the path and .jpg to the result. //Get the date GetDate>TheDate //Replace the / StringReplace>TheDate,/,,TheDate //Set the path to your file Let>FilePath=c:...
- Mon Aug 14, 2023 10:40 pm
- Forum: Technical / Scripting
- Topic: Let + MouseMove
- Replies: 1
- Views: 6218
Re: Let + MouseMove
Either of these would work for photo : Let>photoX=-1100 Let>photoY=662 MouseMove>%photoX%,%photoY% Let>photo=-1100,662 Separate>photo,comma,coord MouseMove>coord_1,coord_2 Date is giving you the error because instead of moving to X and Y coordinates, you're attempting to move to "8/14/2023" which is...
- Sun Aug 13, 2023 6:14 pm
- Forum: Technical / Scripting
- Topic: how to conditionally modify a programs hotkey behavior
- Replies: 8
- Views: 8498
Re: how to conditionally modify a programs hotkey behavior
Without the loop the script isn't running. It will start and immediately reach the end. Step through it line by line and you'll see.
- Sun Aug 13, 2023 3:10 pm
- Forum: Technical / Scripting
- Topic: how to conditionally modify a programs hotkey behavior
- Replies: 8
- Views: 8498
Re: how to conditionally modify a programs hotkey behavior
Code: Select all
//wait for F2 press
OnEvent>KEY_DOWN,VK113,0,ClickOK
label>start
wait>0.1
goto>start
//send ctrl-o to dialogue window
SRT>ClickOK
MessageModal>F2 pressed
//Press CTRL
//send>o
//Release CTRL
END>ClickOK
- Sun Aug 13, 2023 3:07 pm
- Forum: Technical / Scripting
- Topic: CTRL-SPACE as a hotkey for a script
- Replies: 1
- Views: 6051
Re: CTRL-SPACE as a hotkey for a script
CTRL-SPACE is not an option for a hotkey. If you're looking to detect it as an Onevent, the code below will do that :
Code: Select all
OnEvent>KEY_DOWN,VK32,2,KeyPress
//keep the script running
label>loop
wait>0.1
goto>loop
SRT>KeyPress
MDL>CTRL+Space was pressed
END>KeyPress
- Fri Aug 11, 2023 8:06 am
- Forum: Technical / Scripting
- Topic: Having troubles with colors changing for GPC
- Replies: 4
- Views: 7094
Re: Having troubles with colors changing for GPC
Thank you for the update. I'm sure that will help others.
- Sun Aug 06, 2023 2:28 pm
- Forum: Technical / Scripting
- Topic: Having troubles with colors changing for GPC
- Replies: 4
- Views: 7094
Re: Having troubles with colors changing for GPC
If I try getPixelColor on two different laptops on the same image (I used the blue button on the MJT homepage) I get two different value too. This is somewhat to be expected unless each PC has identical colour profiles, graphics settings, any calibration is identical, and you have identical hardware...
- Wed Aug 02, 2023 5:01 pm
- Forum: Beginners
- Topic: Executing Multiple macros
- Replies: 5
- Views: 7806
Re: Executing Multiple macros
If you're passing 2, but the first line of the macro you're running set it to 1, then it will use 1. That makes perfect sense if you think about it. You can simply comment out (or remove) line 1 in ITEMNUM.scp
Code: Select all
//Let>ITEMNUM=1
- Wed Aug 02, 2023 7:04 am
- Forum: Beginners
- Topic: Executing Multiple macros
- Replies: 5
- Views: 7806
Re: Executing Multiple macros
It shouldn't matter if they are recorded. It's the path. It's looking in the Program folder instead of the data folder. Try this (edit if you've put the script somewhere else). Macro>%SCRIPT_DIR%\MyScript.scp Also you don't have to go to the trouble of screenshots to post code. You can use the butto...