Enter URL after prompt in imacros

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
krkannan94
Posts: 44
Joined: Thu May 25, 2017 5:04 am

Enter URL after prompt in imacros

Post by krkannan94 » Thu Jun 08, 2017 3:16 pm

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 5:12 pm, edited 2 times in total.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

Post by chivracq » Thu Jun 08, 2017 3:42 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
krkannan94
Posts: 44
Joined: Thu May 25, 2017 5:04 am

Re: Enter the URL after prompt in imacros

Post by krkannan94 » Thu Jun 08, 2017 4:04 pm

FCIM...! :mrgreen:
sorry for that I'm using iMacros v9.0.3 on Firefox 53.0.3 (64 bit) in Windows 8 x64
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

Post by chivracq » Thu Jun 08, 2017 5:00 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
krkannan94
Posts: 44
Joined: Thu May 25, 2017 5:04 am

Re: Enter the URL after prompt in imacros

Post by krkannan94 » Fri Jun 09, 2017 4:29 am

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)
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Enter the URL after prompt in imacros

Post by chivracq » Fri Jun 09, 2017 10: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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 482
Joined: Fri Feb 20, 2015 9:27 pm

Re: Enter the URL after prompt in imacros

Post by techimac » Wed Jun 14, 2017 8: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)
Available for custom iim, javascript iMacros scripts
Post Reply