Find Text

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Drixer
Newbie
Posts: 1
Joined: Tue Sep 22, 2020 12:56 pm

Find Text

Post by Drixer » Tue Sep 22, 2020 12:59 pm

First, sorry for my English, I'm using the translator

I have a problem, I need to make a sequence, where I have men and women, use the image detector so that when it detects the image where it says "man" it does one thing and if it detects "woman" it does another, but it does not detect the images well. , I wanted to know how I can do that "if" and "else" detecting the text with the word "man" and "woman"

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

Re: Find Text

Post by Dorian (MJT support) » Tue Sep 22, 2020 2:07 pm

Can you post a screenshot of what you're trying to detect? It's likely there's a few ways, and it would help us determine which may be best.

Specifically the if/else/endif part of the code would be something like this :

Code: Select all

If>a condition is met
  do this
else
  do that
endif
So for example, if a=1, do something, if it isn't, do something else :

Code: Select all

Let>a=1
If>a=1
  MessageModal>A is 1
else
  MEssageModal>A is NOT 1
Endif
If you change Let>a=1 to Let>a=2, you can see how it works when a is not one.

Now, exactly what will go in your if/else/endif will differ depending on how we're looking for man/woman. And how we do that will depend on your screenshot.

Just to help with clarity

Code: Select all

Let>gender=man
If>gender=man
  MessageModal>It's a man!
else
  MEssageModal>It's not a man!
Endif
Don't forget though, just because "man" might not be a match, that doesn't mean it's a woman. We can demonstrate this with let>gender=squirrel - it's simply "not a man". So "else" might not be appropriate for you.

It may be better to do this, so that an action is taken only if it's man or woman :

Code: Select all

Let>gender=man

If>gender=man
  MessageModal>It's a man!
Endif

If>gender=woman
  MessageModal>It's a woman!
Endif
Yes, we have a Custom Scripting Service. Message me or go here

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