Search found 1352 matches

by Dorian (MJT support)
Tue Aug 22, 2023 3:47 pm
Forum: Technical / Scripting
Topic: how to boilerplate macros
Replies: 5
Views: 6905

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 ...
by Dorian (MJT support)
Tue Aug 22, 2023 10:07 am
Forum: Technical / Scripting
Topic: how to boilerplate macros
Replies: 5
Views: 6905

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 ...
by Dorian (MJT support)
Mon Aug 21, 2023 7:19 pm
Forum: Technical / Scripting
Topic: select todays dated image
Replies: 3
Views: 5709

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:...
by Dorian (MJT support)
Mon Aug 14, 2023 10:40 pm
Forum: Technical / Scripting
Topic: Let + MouseMove
Replies: 1
Views: 5020

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...
by Dorian (MJT support)
Sun Aug 13, 2023 6:14 pm
Forum: Technical / Scripting
Topic: how to conditionally modify a programs hotkey behavior
Replies: 8
Views: 7098

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.
by Dorian (MJT support)
Sun Aug 13, 2023 3:10 pm
Forum: Technical / Scripting
Topic: how to conditionally modify a programs hotkey behavior
Replies: 8
Views: 7098

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
by Dorian (MJT support)
Sun Aug 13, 2023 3:07 pm
Forum: Technical / Scripting
Topic: CTRL-SPACE as a hotkey for a script
Replies: 1
Views: 4895

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
by Dorian (MJT support)
Fri Aug 11, 2023 8:06 am
Forum: Technical / Scripting
Topic: Having troubles with colors changing for GPC
Replies: 4
Views: 5776

Re: Having troubles with colors changing for GPC

Thank you for the update. I'm sure that will help others.
by Dorian (MJT support)
Sun Aug 06, 2023 2:28 pm
Forum: Technical / Scripting
Topic: Having troubles with colors changing for GPC
Replies: 4
Views: 5776

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...
by Dorian (MJT support)
Wed Aug 02, 2023 5:01 pm
Forum: Beginners
Topic: Executing Multiple macros
Replies: 5
Views: 6519

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
by Dorian (MJT support)
Wed Aug 02, 2023 7:04 am
Forum: Beginners
Topic: Executing Multiple macros
Replies: 5
Views: 6519

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...
by Dorian (MJT support)
Tue Aug 01, 2023 4:44 pm
Forum: Technical / Scripting
Topic: Having Trouble Extracting from a site using Chrome Functions...
Replies: 6
Views: 6463

Re: Having Trouble Extracting from a site using Chrome Functions...

Hover over the element you want, right-click n (inspect), then do it a second time as it often does not select the correct part of the code. Once Developer Tools opens up you can also press CTRL-SHIFT-C - then see what happens when you hover of any page elements. Just as food for thought, below is t...
by Dorian (MJT support)
Tue Aug 01, 2023 9:36 am
Forum: Technical / Scripting
Topic: Having Trouble Extracting from a site using Chrome Functions...
Replies: 6
Views: 6463

Re: Having Trouble Extracting from a site using Chrome Functions...

The trick was to get the entire job panel. There are 15 of them so you should see 15 results. From this : < td class =" resultContent "><div class="css-1m4cuuf e37uo190"><h2 class="jobTitle css-1h4a4n5 eu4oa1w0" tabindex="-1"> We get: ChromeFindElements>session_id,xpath,// td [@ class =' resultConte...
by Dorian (MJT support)
Mon Jul 31, 2023 8:53 am
Forum: Technical / Scripting
Topic: Compiled Script Logging?
Replies: 11
Views: 20192

Re: Compiled Script Logging?

Just after I hit submit it occurred to me that if you wanted to delete that logfile after running, you could put this at the end of your script :

Code: Select all

If>writelogfile=False
Deletefile>D:\mondaylogINI.log
Endif
Sign up to our newsletter for free automation tips, tricks & discounts