CApyn
CApyn

Reputation: 1

How do I abort when value is present in iMacro?

I have been searching far and wide throughout google to no avail. I am really hungry for some wisdom and guidance as I am new to this! :)

MY IMACRO CODE

SET !ERRORIGNORE YES

URL GOTO=https: (URL LINK GOES HERE)

TAG POS=1 TYPE=* ATTR=TXT:1<SP>NEW CONTENT=EVENT:FAIL_IF_FOUND

SET !ERRORIGNORE NO

SET !TIMEOUT_STEP 10

'Or more simply put:

URL GOTO=https: (URL LINK GOES HERE)

TAG POS=1 TYPE=* ATTR=TXT:1<SP>NEW CONTENT=EVENT:FAIL_IF_FOUND

OPERATING SYSTEM

Running this on the latest firefox with the latest iMacro (.iim) - Trouble shooting on windows live (SP 2) and also Mac Book Pro (Yosemite 10.1.1)

CONTEXT

I have a script that is automating tasks - But people can see my activity. When people message me I want my script to see a new message then abort the script with an error FAIL_IF_FOUND.

PROBLEM

The problem here is that SET !ERRORIGNORE YES cancels out my FAIL_IF_FOUND command.

TROUBLE SHOOTING

I have tried so many variations with !ERRORIGNORE YES and !ERRORIGNORE NO placing them all in different positions but regardless if a message comes in or not the !ERRORIGNORE YES continues the loop and ignores FAIL_IF_FOUND...

Ironically if I remove !ERRORIGNORE YES then begin loop it stops if a message comes, BUT if there is no message the error "element * specified by TXT:1NEW was not found, line: 2 (Error code: -921)" occurs...

I cannot seem to get it to loop even though the element/value is not present. I also am not too familiar with Java script as well.

POSSIBLE SOLUTION

My solution (unless you have a better one) would be to make a condition using the EVAL command.

The condition being, if "1 New" value is seen, then Abort Macro with Error.

QUESTION

Would someone here have a possible solution?

Upvotes: 0

Views: 558

Answers (1)

Shugar
Shugar

Reputation: 5299

This simple macro should work for you:

URL GOTO=https: (URL LINK GOES HERE)
TAG POS=1 TYPE=* ATTR=TXT:1<SP>NEW CONTENT=EVENT:FAIL_IF_FOUND

And there must not be any errors like:

element * specified by TXT:1NEW was not found, line: 2 (Error code: -921)

Upvotes: 0

Related Questions