PROMPT Messagebox - Yes - No - Cancel (end)

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by MattBuck on Tue Dec 22, 2015 12:39 pm

This functionality would greatly enhance iMacros, especially for those of us that are looking to do write a script without having to use other means to execute (use of VB, javascript, etc.).

Please add this functionality to your next release of iMacros.
MattBuck
 
Posts: 6
Joined: Mon Nov 30, 2015 10:43 am

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by chivracq on Wed Jan 13, 2016 10:50 am

Some Update on this one and finally some GOOD NEWS, as I've finally discovered a way to achieve a Conditional PROMPT on FF in pure '.iim', thanks to another Bug (ah-ah-ah...!) that I just discovered... Youpidoo...!! Ah-ah...!, ironic to see that one Bug helps to solve (or at least to find a Workaround for another one)...! I'm not completely sure yet it will be applicable for "complex" PROMPT's with Input Variables as it would require to embed Vars in Vars and I know for example that it's not possible to embed a Command in a Var, but it will work for "simple" Display OK-PROMPT's.

Tja, let's play a little Game and see if sbd else, TechSupport for example eh-eh-eh...!, can discover it as well..., gniarf-gniarf...!

Hint Nr 1:
The (2nd) Bug I just discovered gives the following RuntimeError:
Code: Select all
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITransferable.getTransferData], line 9 (Error code: -1001)
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64.)
- (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: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by chivracq on Thu Jan 14, 2016 5:32 pm

chivracq wrote:Tja, let's play a little Game and see if sbd else, TechSupport for example eh-eh-eh...!, can discover it as well..., gniarf-gniarf...!

Hint Nr 1:
The (2nd) Bug I just discovered gives the following RuntimeError:
Code: Select all
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITransferable.getTransferData], line 9 (Error code: -1001)
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64.)

Hum..., nobody wants to play with me...!!!??? :shock: :shock:

OK, Hint Nr 2:
Part of the Trick is to use an Empty String... in a Var, like I already mentioned... :lol:
- (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: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by chivracq on Fri Jan 15, 2016 5:39 am

chivracq wrote:
chivracq wrote:Tja, let's play a little Game and see if sbd else, TechSupport for example eh-eh-eh...!, can discover it as well..., gniarf-gniarf...!

Hint Nr 1:
The (2nd) Bug I just discovered gives the following RuntimeError:
Code: Select all
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITransferable.getTransferData], line 9 (Error code: -1001)
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64.)

Hum..., nobody wants to play with me...!!!??? :shock: :shock:

OK, Hint Nr 2:
Part of the Trick is to use an Empty String... in a Var, like I already mentioned... :lol:

Hum, not many People seem to be interested, grr...!! But OK, I've got my Proof of Concept ready and it works fine... but only for Informative PROMPT's, and not for PROMPT's that require some User Input, because the Technique I use would require to be able to embed a Variable in a Variable and it doesn't work, iMacros treats the embedded Var as a String. I miss a Switch/Command like '#NOVAR#' that does the contrary and treats the Double Curly Brackets of a Var as a String... Or like I've already asked as an Enhancement Request, I miss a "Super" Built-in Var that could contain Commands like 'PAUSE', 'REFRESH', even 'PROMPT' and other (Built-in) Vars.

But anyway, it is already Friday afternoon (for me in Europe), so I will already disclose my Proof of Concept, in case anybody wants to play with it on a boring Friday afternoon at work or during the WE, ah-ah...!!

The little Bug I discovered while doing some Testing for this Thread with 'PROMPT' and the Clipboard came from the fact that I wanted to reset the Content of the Clipboard to NULL between several Tests in the same Macro but iMacros treats "NULL" in 'SET !CLIPBOARD NULL' like a String. Funny I thought, but no Pb, I will just set it to an Empty String then:
Code: Select all
SET !CLIPBOARD ""
PROMPT {{!CLIPBOARD}}

But this simple Code yields the RuntimeError I already mentioned in a previous Post...

Hum, strange, I thought, I tried a few things with Temp (Built-in) Vars, but same Result each time the Clipboard has been set to an Empty String and I tried to PROMPT it... But the good news was when using '!ERRORIGNORE', the 'PROMPT' Statement just does nothing and that gave me the clever Idea to try to misuse that Behaviour for a Conditional PROMPT, and yep, it works, but only for Informative PROMPT's, like I already mentioned.

So here is the Proof of Concept, you can just run it as is, first 1 Play and after with Loop (=10 or >10), It contains several Conditional PROMPT's that are self-explanatory with some extra Info. Enjoy and Feedback welcome...!
'This Macro is a Proof of Concept to demonstrate a Conditional PROMPT in pure '.iim' for iMacros for FF.
'Several Conditional PROMPT's will be displayed while looping the Macro, and only for a few specific Loops.
'Unfortunately, this Method only works for Informative PROMPT's and not for PROMPT's that require some User Input.
'Warning...!: This Technique uses the OS Clipboard and resets it a few times to NULL,
'... meaning that you lose the Content of the Clipboard if you had stg stored in it before running/looping this Macro. Oops...!
'>
'Proof of Concept made by 'JF CHIVRACQ', January 2016, for the iMacros Forum.
'Feel free to reuse/improve. Enjoy...!!


Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES

'This Macro is a Proof of Concept to demonstrate a Conditional PROMPT in pure '.iim' for iMacros for FF.
'Several Conditional PROMPT's will be displayed while looping the Macro, and only for a few specific Loops.
'Unfortunately, this Method only works for Informative PROMPT's and not for PROMPT's that require some User Input.
'Warning...!: This Technique uses the OS Clipboard and resets it a few times to NULL,
'... meaning that you lose the Content of the Clipboard if you had stg stored in it before running/looping this Macro. Oops...!
'>
'Proof of Concept made by 'JF CHIVRACQ', January 2016, for the iMacros Forum.
'Feel free to reuse/improve. Enjoy...!!

'SET Clipboard_Temp {{!CLIPBOARD}}
'Loop 1:
SET PROMPT_Msg "This is a Conditional PROMPT, only for Loop=1."
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg "Try looping this Macro for more than 10 times, you will get another Conditional PROMPT at Loop=5 and Loop=10 and the Macro will automatically stop after the last PROMPT at Loop=10...!"
'>
SET !CLIPBOARD EVAL ("if('{{!LOOP}}'==1){var x='{{PROMPT_Msg}}';} else {x='';}; x;")
PROMPT {{!CLIPBOARD}}

'Loop 3:
SET PROMPT_Msg "BUG...!! This is only Loop=3, I'm not supposed to get a PROMPT for this Loop...!"
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg  "But hum, I didn't get a PROMPT for Loop=2, so hum..., maybe it works...!"
'>
SET !CLIPBOARD EVAL ("if('{{!LOOP}}'==3){var x='{{PROMPT_Msg}}';} else {x='';}; x;")
PROMPT {{!CLIPBOARD}}

'Loop 5:
SET PROMPT_Msg "OK, this is Loop=5, I expected this PROMPT and I didn't get one for Loop=4. This looks good...!"
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg "The next (and final) PROMPT should now only come at Loop=10."
'>
SET !CLIPBOARD EVAL ("if('{{!LOOP}}'==5){var x='{{PROMPT_Msg}}';} else {x='';}; x;")
PROMPT {{!CLIPBOARD}}

'Loop 10:
SET PROMPT_Msg "This is the final Loop (Loop=10), the Macro will now abort even if you specified a Nb>10 to loop it..."
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg  "But notice that you only got PROMPT's at Loop=1+3+5+10."
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg  "Unfortunately, this Method only works for Informative PROMPT's and not for PROMPT's that require some User Input."
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg  "Warning...!: This Technique uses the OS Clipboard and resets it a few times to NULL, meaning that you lost the Content of the Clipboard if you had stg stored in it before running/looping this Macro. Oops...!"
ADD PROMPT_Msg <BR>
ADD PROMPT_Msg "(And the Content of this current PROMPT is now stored in the Clipboard...!)"
ADD PROMPT_Msg <BR><BR>
ADD PROMPT_Msg  "Proof of Concept made by 'JF CHIVRACQ', January 2016, for the iMacros Forum."
ADD PROMPT_Msg <BR>
ADD PROMPT_Msg "Feel free to reuse/improve. Enjoy...!!"
'>
SET !CLIPBOARD EVAL ("if('{{!LOOP}}'==10){var x='{{PROMPT_Msg}}';} else {x='';}; x;")
PROMPT {{!CLIPBOARD}}
'SET !CLIPBOARD ""

'Prepare Report Msg:
SET Report_Msg <SP><SP><SP>No<SP>Error...!
ADD Report_Msg <BR><BR>
ADD Report_Msg "Proof of Concept for a Conditional PROMPT at Loop=1+3+5+10 before aborting."
ADD Report_Msg <BR><BR>

'Abort Macro and display mini-Report:
SET !ERRORIGNORE NO
SET Abort_Macro EVAL("if('{{!LOOP}}'==10) {MacroError('{{Report_Msg}}');}")
(Tested on iMacros for FF v8.8.2, Pale Moon v24.6.2 (=FF31), Win7-x64.)
- (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: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by chivracq on Fri Nov 11, 2016 10:43 am

Ah-ah...!, Update Novb 2016, with again some good news, ah-ah...!

Concerning the following "buggy" Statement advertised in the Wiki which doesn't work in FF since v7.5.x or v8.0.x:
Code: Select all
URL GOTO=javascript:alert("TEST");

Well, Advanced User @iimfun posted another Workaround in the following Thread:
- Re: Displaying window.alert()
iimfun wrote:Sometimes a miracle may happen
Code: Select all
URL GOTO=javascript:setTimeout("alert('TEST');",300);void(0);

And yep, it works, I tested on:
Code: Select all
iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64
+ iMacros for FF v8.9.7, FF47, Win10-x64

=> This opens the door again for some more Complex Conditional PROMPT than with my own Workaround, and even for Input PROMPT's as I guess it will work as well with 'confirm()' and I don't remember the name of the third similar JavaScript Function for DialogBoxes...
- (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: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by chivracq on Sat May 27, 2017 6:54 am

Keeping Track of all Threads related to 'PROMPT' in this current Thread, => several Threads related to CR58 that appears to break the 'PROMPT' Command (in v8.4.4 for CR):
- Capturing EXTRACT data
- PROMPT not working in latest Chrome 58.xx
- (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: 6477
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: PROMPT Messagebox - Yes - No - Cancel (end)

by iimfun on Mon Nov 13, 2017 1:23 am

But if you guys are looking for something special, here is it.
iimfun
 
Posts: 239
Joined: Tue Jul 19, 2016 6:06 am

Previous

Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 8 guests

-->