Forum rulesBefore 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:

If a message box (PROMPT ... or input box) appears, then this appears exclusively modal. This means that it is in the foreground, without that you can stop the script at this point in the iMacros toolbar.

What to do?

(2)

How can I get a message box (PROMPT) show, in which it, "No", "Cancel" is the "Yes" button?

The iMacros macro language does not provide the ability to do conditional (if/then) branching. For this you need to put your logic into a custom script and use the scripting interface to control iMacros.

iMacros 10, Windows 8 / 64, I use the iMacros Browser (not MSIE) - sometimes Firefox - every time the last version - 2014-12-10

Not impressed by your Follow-up, 1½ years later...

And mentioning your FCI is a good thing (otherwise I wouldn't answer your Thread...) but putting it in your Sig is not the best place as you only have one global Sig for all your Msg's and it makes your Msg's from 1½ years ago and in 1½ years a bit confusing...

But I tested Tom's Code and it works fine for me, but the Macro stops only if the User types "y" or "Y" and then presses 'OK' (and not 'Cancel').

And this made me discover a little Bug in my Opinion, that when looping the Macro, if '!ERRORIGNORE' is used (set to 'YES'), that Setting is global and it is not reset to 'NO' at the end of each Loop, meaning you are indeed required to set '!ERRORIGNORE' to 'NO' just before the 'EVAL()' with 'MacroError()'...

I changed Tom's Code a little bit to "my preferred" Notation as I didn't get it to work directly because of the '!ERRORIGNORE' mini-Problem, but both Statements work fine...:

- (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...

But I tested Tom's Code and it works fine for me, but the Macro stops only if the User types "y" or "Y" and then presses 'OK' (and not 'Cancel').

The Question presented by the Prompt is "Do you want to abort the macro? Y/N"=> If you want to abort the Macro, you need to press 'Y' or 'y' (Tom took care of the Case Sensitivity, look a little bit at the 'EVAL()' Statement to understand as well what it is doing...) and then click on 'OK'.... If you click on 'Cancel', that means "Oops, mistake, go away stupid Prompt, I don't want you to do anything...!" => 'Cancel' = Cancel the PROMPT...! (... And do nothing...)

The iMacros 'PROMPT' only has 'OK'/'Cancel', there is no 'Yes'/'No' or 'Yes'/'No'/'Cancel'..., so 'Yes' takes an Action, and 'Cancel' does nothing...It is possible to reverse the 'EVAL()' Statement if you want 'Cancel' actually to stop the Macro but you need to change the Question as well..., otherwise it's not logical...

- (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...

i_macro_user wrote:I try it in iMaros 10 and in inMacros for Firefox / Windows 8 /64.

I click cancel - and I got the Message from the Script-Line:

PROMPT "You pressed {{!VAR2}}"

"You pressed N"

When I run my original code above using iMacros 10.4 in the iMacros Browser or iMacros for IE, the result I get when clicking the Cancel button is "You pressed Cancel".

However, doing the same in iMacros for Firefox yields "You pressed N".

The reason for the difference is because iMacros for Firefox assigns the default value (the third parameter to the PROMPT command) to the input variable *even if* you click Cancel, whereas iMacros for IE does not (in this case it assigns an empty/null value to !VAR1).

You can see this for yourself by adding PROMPT {{!VAR1}} after the first PROMPT command.

The workaround for iMacros for Firefox would be to not specify a default value in the prompt command:

Yep, that's indeed the Behaviour I observed..., but I wasn't shocked...! (But I only tested on iMacros for FF (v8.8.2).)

>>>

Nice as well if the Developer(s) "work" on the 'PROMPT' Command would be to add an Enhancement Request for an extra Parameter to define the Prompt Type:- OK (Default if no Input Var is defined.)- OK/Cancel (Default if an Input Var is defined.)- YES/NO- YES/NO/Cancel(with OK/Cancel being the Default if nothing is specified...)

>>>

And nice as well would be to have another Parameter when looping a Macro to be able to specify when the PROMPT will be triggered:- All Loops (Default).- Only First Loop.- Only Last Loop (-1).- Only Loop n.- Only Loops 3,4,5,10-15,*2*.

>>>

And while the Developer(s) look(s) at 'PROMPT', another thing related to PROMPT which is not working is this bit from the Wiki on 'URL GOTO':

Using Javascript

The URL can also call Javascript functions that are either defined in this line or are embedded in the page (V6.22 and later):

- (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 wrote:And while the Developer(s) look(s) at 'PROMPT', another thing related to PROMPT which is not working is this bit from the Wiki on 'URL GOTO':

Using Javascript

The URL can also call Javascript functions that are either defined in this line or are embedded in the page (V6.22 and later):

Code: Select all URL GOTO=javascript:alert("TEST");

This prevents from making Conditional PROMPT's with 'EVAL()'...

I was unaware of this until now. The reason this no longer works is because iMacros thinks it is an unhandled dialog and returns error code -1450. Running the same code in iMacros browser/IE successfully displays the alert dialog. I have logged this for further investigation by the development team.

As far as the other suggestions, they are nice, but I would not hold your breath for those unless we start getting many other similar requests.

chivracq wrote:And while the Developer(s) look(s) at 'PROMPT', another thing related to PROMPT which is not working is this bit from the Wiki on 'URL GOTO':

Using Javascript

The URL can also call Javascript functions that are either defined in this line or are embedded in the page (V6.22 and later):

Code: Select all URL GOTO=javascript:alert("TEST");

This prevents from making Conditional PROMPT's with 'EVAL()'...

I was unaware of this until now. The reason this no longer works is because iMacros thinks it is an unhandled dialog and returns error code -1450. Running the same code in iMacros browser/IE successfully displays the alert dialog. I have logged this for further investigation by the development team.

It's been broken already for 2 or 3 years, from iMacros for FF v8.x, I think..., I've reported/mentioned it already several times in different Threads... But good that you are aware of it now...

Oh...!, and it's not only 'alert()' but the 2 or 3 other similar JavaScript Functions triggering DialogBoxes that are impacted as well, I don't remember their Names...

Tom, Tech Support wrote:As far as the other suggestions, they are nice, but I would not hold your breath for those unless we start getting many other similar requests.

Yep, I know, don't worry, I only hold my breath when I'm under water, if I had been holding my breath since I've asked for a '!LOOP_MAX' Built-in Variable to be implemented and for several Bugs pertaining to the EVENT Mode to be solved, I wouldn't be posting on the Forum anymore since a long time...

And once "URL GOTO=javascript:alert("TEST");" works (again), I will be able to find (easier) Workarounds for all the Conditional Prompts (in pure .iim)... (I already have one but it's not very handy...)

I only mentioned these Enh-Req's for 'PROMPT' if the Developer(s) is/are going to dig into the Code for 'PROMPT', then it's easier to tackle several Tasks (if nothing new gets broken...!) because 50% of the Effort has already been done...

- (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...

Speaking of EVENT mode, I'll let you in on a little secret: EVENT mode is currently being implemented for iMacros for IE and iMacros browser. I made the devs aware of your forum thread giving feedback, and hoping that the iMacros-FX and iMacros-IE teams collaborate to make enhancements and keep the functionality consistent between iMacros versions. It might not happen right away, but over time it should improve.

many thanks - now I understand - only Y is possible in this construction

Manchmal sieht man den Wald vor lauter Bäumen nicht

Yep, you're welcome... (Late reply, though I had seen your Reply at the time you had posted it...)

Don't blame the Trees though, they are your best Friends...! There is some Tribe somewhere in Africa I think, or somewhere in the Amazon maybe, well in some place on this Planet where there are Elephants...!, where they live in some very dense Forest Environment and never see any further than 20m away..., and when they happen to find some open space and see an Elephant at 200m, they won't recognize it as an Elephant but will think it's a Fly...! or any tiny Beastie, because of the Distance...

>>>

OK, reason I checked this Thread and want to bump it:Some other User/Thread that would benefit from the EnhReq I posted about '!LOOP':- Re: Using a variable to set the datasource name.(The Thread Title doesn't sound much like it is really related but it is, it came as a follow-up Question to the Original Question, and I referred in that Thread to this current Thread/EnhReq...)

MattBuck wrote:I was afraid you were going to tell me that.

This is exactly what would benefit me:

And nice as well would be to have another Parameter when looping a Macro to be able to specify when the PROMPT will be triggered:- All Loops (Default).- Only First Loop.- Only Last Loop (-1).- Only Loop n.- Only Loops 3,4,5,10-15,*2*.

How do we get this "bumped" so that it appears in the next version of iMacros? Or maybe, it was included in the latest release (Ver. 11) and we just don't know it yet (fortunately, the company that I work for just renewed our support agreement and I can upgrade ).

Crossing my fingers that if it isn't in Ver. 11 that it is included in Ver. 11.1

For now, I may have to rely on the users editing the script {shudders at the thought} until another solutions presents itself.

The User I quote will probably bump the Thread as well, or I will strongly/nicely entice him to do so, 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...