assign a built in variable to a scription variable?

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Juliensohn
Posts: 6
Joined: Sat Sep 27, 2014 5:07 am

assign a built in variable to a scription variable?

Post by Juliensohn » Sun Sep 28, 2014 6:57 pm

Hey, I have 2 variables


The first is

{{!var9}} and contains a Text ("(Please enter the words above)")

the seconds variable is

var ifcaptcha;


now i want to do something like that

ifcaptcha = {{!var9}};

__
if someone has an idea how to do this please reply. I tried for 3 hours now and nothing worked..



Edit://
I do it in javascript, because i need a if/else
skippyto
Posts: 108
Joined: Wed Aug 20, 2008 8:14 am

Re: assign a built in variable to a scription variable?

Post by skippyto » Mon Sep 29, 2014 9:36 am

Hi Juliensohn,

{{!var9}} and contains a Text ("(Please enter the words above)") is not some javascript.

If you want to do it with iMacros (http://wiki.imacros.net/PROMPT) :

Code: Select all

SET !VAR9 "(Please enter the words above)"
PROMPT {{!VAR9}} !VAR9
Or simplier

Code: Select all

PROMPT "(Please enter the words above)" !VAR9
Then just use

Code: Select all

ADD !EXTRACT {{!VAR9}}
to get the value in your js with iimGetExtract (http://wiki.imacros.net/iimGetExtract)

If you want help with your js script, post your javascript code. But I think it's nearly the same :

Code: Select all

var ifcaptcha = prompt("(Please enter the words above)", "Captcha value");
Skippyto.
Juliensohn
Posts: 6
Joined: Sat Sep 27, 2014 5:07 am

Re: assign a built in variable to a scription variable?

Post by Juliensohn » Mon Sep 29, 2014 12:05 pm

skippyto wrote:Hi Juliensohn,

{{!var9}} and contains a Text ("(Please enter the words above)") is not some javascript.

If you want to do it with iMacros (http://wiki.imacros.net/PROMPT) :

Code: Select all

SET !VAR9 "(Please enter the words above)"
PROMPT {{!VAR9}} !VAR9
Or simplier

Code: Select all

PROMPT "(Please enter the words above)" !VAR9
Then just use

Code: Select all

ADD !EXTRACT {{!VAR9}}
to get the value in your js with iimGetExtract (http://wiki.imacros.net/iimGetExtract)

If you want help with your js script, post your javascript code. But I think it's nearly the same :

Code: Select all

var ifcaptcha = prompt("(Please enter the words above)", "Captcha value");
Skippyto.
Oh sorry, my fault!!

Code: Select all

macroStart1 +="TAG POS=4 TYPE=TD ATTR=TXT:* EXTRACT=TXT" + "\n";
macroStart1 +="SET !VAR9 {{!EXTRACT}}" + "\n";
^This is how i got the content of {{!VAR9}} - and it extracts some Text like "Please enter the words above" (in German)
So i didn't want to let the user type something in.


On the End I want to do something like:

Code: Select all

if !Var9 == "Please enter the words above"
{
Do this
}

if !Var9 != "Please enter the words above"
{
Do that
}
But I don't know how to use {{!VAR9}} in an if
so I wanted to use a normal variable (var Ifcaptcha)

Hope it's easier to understand now, I can't explain good in english :p



EDIT://

This worked!

Code: Select all

macroStart +="TAG POS=1 TYPE=TEXTAREA FORM=ID:question_form ATTR=ID:profile-input CONTENT={{!var9}}" + "\n";
macroStart +="ADD {{!EXTRACT}} !VAR9" + "\n";
ifcaptcha=iimGetExtract();
Post Reply