1

on iMacros, it is possible to retrieve a javascript variable to iMacros.

Like this: SET !VAR1 EVAL("var ... ;")

But I have been looking for several days how do the opposite? I found nothing in the documentation or elsewhere on the www. retrieve a IMacros variable, and use within Javascript, Is this possible?

thank you

2 Answers 2

2

Using !EXTRACT

You can add value to !EXTRACT var in .iim file, then use iimGetLastExtract() to get this value.

For example:

In .iim file:

SET !EXTRACT "123"

In .js file:

var str = iimGetLastExtract()
alert(str)
Sign up to request clarification or add additional context in comments.

Comments

1

You can use {{VARNAME}} inside your javascript:

SET x "hello"
SET !VAR1 EVAL("var x='{{x}}'; x+' world'")
PROMPT {{!VAR1}}

It'll alert hello world

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.