BAvilla Posted August 2, 2017 Report Share Posted August 2, 2017 I am just starting to work with MEP, and am not at all a programmer. So I'm hoping this question will be an easy one for the users that have been around for years... Ref: which gave me the idea: My goal - I have a program that will be processing a variable amount of barcode documents, and am not sure how long each batch will take - usually less than 2 minutes. So I hope to use a "wait for pixel color" to change to trigger that the batch is completed. Here's what I have so far, that's not working: The color of the text changes to blue which is 9109504, based on the Mouse Locator reading. The coordinates of the exact full screen location are x=437 and y=741 <REPEAT UNTIL Variable="%N[1]%" Condition="\x00" Value="9109504"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="TRUE" X="437" Y="741" Destination="%N[1]%"/> <DELAY Flags="\x01" Time="2"/> <IF VARIABLE Variable="%N[1]%" Condition="\x00" Value="9109504" IgnoreCase="FALSE"/> <END REPEAT/> <TEXT TYPE Action="0" Text="<ALT>f"/> <TEXT TYPE Action="0" Text="X"/> The messages at the bottom of the script editor say: Line 1: Missing "End Repeat" Line 5: Mismatched "End Repeat" Thank you in advance for your able assistance! Bruce in Fayetteville, TN. Quote Link to comment Share on other sites More sharing options...
Cory Posted August 2, 2017 Report Share Posted August 2, 2017 It's not the repeat. You are missing and "End If" that should be paired with Line 4. Quote Link to comment Share on other sites More sharing options...
rberq Posted August 3, 2017 Report Share Posted August 3, 2017 You are close, but the IF needs an END IF. Structurally the code below should work and should not produce an error diagnostic.Logically your instructions check the pixel color variable twice: (1) in the REPEAT UNTIL line and (2) in the IF VARIABLE EQUALS line. You don’t need to check it both places, because either one will exit from the REPEAT loop and go to the TEXT TYPE instruction. Repeat Until Variable Equals Get Pixel Color into Variable If Variable Equals Repeat Exit End If Delay 2 Seconds Repeat End Text Type Text Type Quote Link to comment Share on other sites More sharing options...
Cory Posted August 3, 2017 Report Share Posted August 3, 2017 You're right rberg. I didn't notice he was looking at the same variable. Line 4 simply needs to be removed. Quote Link to comment Share on other sites More sharing options...
BAvilla Posted August 3, 2017 Author Report Share Posted August 3, 2017 Cory and rberg - Got it! Works like a champ. The first four lines are all that's needed to make this work. The remaining lines are used to exit out of the running program. I really appreciate your quick assistance! This MEP has amazing capabilities, and it's wonderful to have expert assistance in this forum to sort out the nitty gritty details for us novice users. Thank you! Quote Link to comment Share on other sites More sharing options...
Cory Posted August 4, 2017 Report Share Posted August 4, 2017 My pleasure 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.