Enter URL after prompt in imacros

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Enter URL after prompt in imacros

by krkannan94 on Thu Jun 08, 2017 8:16 am

english isn't my first language so please excuse any mistakes :)
i want to run imacros with url instead of direct url i want to enter after the prompt is it possible ?? i already tried that but it always ends with fails with error " http://undefined/ "

here is my imacros code :
Code: Select all
var macro;
macro =  "CODE:";
var URLN = prompt("Please enter your URL: ");
var CHOICE = prompt("Please enter your Choice: ");
macro +=  "VERSION BUILD=8970419 RECORDER=FX" + "\n";
macro +=  "TAB T=1" + "\n";
macro +=  "TAB CLOSEALLOTHERS" + "\n";
macro +=  "TAB T=2" + "\n";
macro +=  "URL GOTO={{!URLN}}" + "\n";
macro +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:{{!CHOICE}}" + "\n";
iimPlay(macro)


any ideas to enter the URL after prompt, and thanks in adv
Last edited by krkannan94 on Thu Jun 15, 2017 10:12 am, edited 2 times in total.
krkannan94
 
Posts: 24
Joined: Wed May 24, 2017 10:04 pm

Re: Enter the URL after prompt in imacros

by chivracq on Thu Jun 08, 2017 8:42 am

krkannan94 wrote:english isn't my first language so please excuse any mistakes :)
i want to run imacros with url instead of direct url i want to enter after the prompt is it possible ?? i already tried that but it always ends with fails with error " http://undefined/ "

here is my imacros code :
Code: Select all
var macro;
macro =  "CODE:";
var URLN = prompt("Please enter your URL: ");
var CHOICE = prompt("Please enter your Choice: ");
macro +=  "VERSION BUILD=8970419 RECORDER=FX" + "\n";
macro +=  "TAB T=1" + "\n";
macro +=  "TAB CLOSEALLOTHERS" + "\n";
macro +=  "TAB T=2" + "\n";
macro +=  "URL GOTO={{!URLN}}" + "\n";
macro +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:{{!CHOICE}}" + "\n";
iimPlay(macro)


any ideas on how to enter the URL after prompt, and thanks in adv

FCIM...! :mrgreen:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5996
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

by krkannan94 on Thu Jun 08, 2017 9:04 am

FCIM...! :mrgreen:


sorry for that I'm using iMacros v9.0.3 on Firefox 53.0.3 (64 bit) in Windows 8 x64
krkannan94
 
Posts: 24
Joined: Wed May 24, 2017 10:04 pm

Re: Enter the URL after prompt in imacros

by chivracq on Thu Jun 08, 2017 10:00 am

krkannan94 wrote:
FCIM...! :mrgreen:


sorry for that I'm using
Code: Select all
iMacros v9.0.3 on Firefox 53.0.3 (64 bit) in Windows 8 x64

OK for FCI, I won't react next time if you don't mention it when you open a Thread...

Well, oh-yeah..., you are making a bit of a "messy-mix" between '..iim' and '.js', ah-ah...!

If this Syntax works (?) to fire a Prompt from JavaScript:
Code: Select all
var URLN = prompt("Please enter your URL: ");

... then you need to pass the Content to your on-the-fly '.iim' Macro using 'iimSet()' with some "correct" exact Name for your Vars, and the '!' for iMacros Vars is reserved for Built-in Vars...

I don't understand btw why you want to use a '.js' Script, you are making things very complicated for yourself, ah-ah...!
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5996
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

by krkannan94 on Thu Jun 08, 2017 9:29 pm

Well, oh-yeah..., you are making a bit of a "messy-mix" between '..iim' and '.js', ah-ah...!

If this Syntax works (?) to fire a Prompt from JavaScript:
Code: Select all
var URLN = prompt("Please enter your URL: ");

... then you need to pass the Content to your on-the-fly '.iim' Macro using 'iimSet()' with some "correct" exact Name for your Vars, and the '!' for iMacros Vars is reserved for Built-in Vars...

I don't understand btw why you want to use a '.js' Script, you are making things very complicated for yourself, ah-ah...!


thanks its working :) :) :) :) :)

Code: Select all
var macro;
macro =  "CODE:";
var URLN = prompt("Please enter your URL: ");
var CHOICE = prompt("Please enter your Choice: ");
macro +=  "VERSION BUILD=8970419 RECORDER=FX" + "\n";
macro +=  "TAB T=1" + "\n";
macro +=  "TAB CLOSEALLOTHERS" + "\n";
macro +=  "TAB T=2" + "\n";
macro +=  "URL GOTO={{URLN}}" + "\n";
macro +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:{{CHOICE}}" + "\n";
iimSet("urln",URLN)
iimSet("choice",CHOICE)
iimPlay(macro)
krkannan94
 
Posts: 24
Joined: Wed May 24, 2017 10:04 pm

Re: Enter the URL after prompt in imacros

by chivracq on Fri Jun 09, 2017 3:27 am

krkannan94 wrote:thanks its working :) :) :) :) :)

Code: Select all
var macro;
macro =  "CODE:";
var URLN = prompt("Please enter your URL: ");
var CHOICE = prompt("Please enter your Choice: ");
macro +=  "VERSION BUILD=8970419 RECORDER=FX" + "\n";
macro +=  "TAB T=1" + "\n";
macro +=  "TAB CLOSEALLOTHERS" + "\n";
macro +=  "TAB T=2" + "\n";
macro +=  "URL GOTO={{URLN}}" + "\n";
macro +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:{{CHOICE}}" + "\n";
iimSet("urln",URLN)
iimSet("choice",CHOICE)
iimPlay(macro)

OK, yep, very good...! (And Thanks for sharing, that's perfect Use of the Forum...!)

Subsidiary Qt, (even if I already asked it indirectly in my previous Post but you didn't react), why do you want to use a '.js' Script...?
Your Script would be much simpler in pure '.iim'... :idea:
=> Make the same Script in pure '.iim' for the "sake" (not talking about testing Japanese local products...!) of "practicing" a bit and you'll see the Difference, ah-ah...! :idea:
(I already mentioned/asked in my previous Post, you didn't react, not a big-big deal, I will still help you in a next Thread but I don't really like it when I say/ask stg and Users/People don't react/answer, ah-ah...!)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 5996
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

by techimac on Wed Jun 14, 2017 1:06 pm

use this

changed TAB T= number line
since you are closing all tabs from TAB 1 there is no TAB 2 left

Code: Select all
var macro;
macro =  "CODE:";
macro +=  "PROMPT \"Please enter your URL:\" URLN" + "\n";
macro +=  "PROMPT \"Please enter your Choice:\" CHOICE" + "\n";
macro +=  "TAB T=2" + "\n";
macro +=  "TAB CLOSEALLOTHERS" + "\n";
macro +=  "TAB T=1" + "\n";
macro +=  "URL GOTO={{URLN}}" + "\n";
macro +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:{{CHOICE}}" + "\n";
iimPlay(macro)
techimac
 
Posts: 163
Joined: Fri Feb 20, 2015 2:27 pm


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 10 guests

-->