Can I use javascript to hide a visible iimDisplay message?

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
sightunseen
Posts: 67
Joined: Fri Apr 19, 2013 4:54 am

Can I use javascript to hide a visible iimDisplay message?

Post by sightunseen » Tue Feb 11, 2014 7:02 am

Hi I am using iMacros 8.6.0 in Firefox 24. In the wiki entry for iimDisplay it says:
#HIDEDISPLAY# - hides the message box

I tried iimDisplay("#HIDEDISPLAY#"); but it doesn't hide a display message if one is visible. I'm running a js file and when it exits sometimes it uses iimDisplay to write a diagnostic message in that green box in the iMacros panel. I am then clicking on my script to run it again and sometimes I forget to hit the X and close the display message before I do that. Then I'm left wondering is the message I'm seeing from the last time I ran the script or from the current time? If there's a way to hide an old display message when a new js script is executed that would be ideal. Thanks
chivracq
Posts: 8636
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can I use javascript to hide a visible iimDisplay messag

Post by chivracq » Tue Feb 11, 2014 10:11 am

Yes, just put yourself an iimDisplay() msg at the very Beginning of your Script...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
sightunseen
Posts: 67
Joined: Fri Apr 19, 2013 4:54 am

Re: Can I use javascript to hide a visible iimDisplay messag

Post by sightunseen » Tue Feb 11, 2014 9:48 pm

chivracq wrote:Yes, just put yourself an iimDisplay() msg at the very Beginning of your Script...
Yeah I could do that but I really would rather hide the message. How about a different example, like when an iimPlay fails if I handle the error code I don't want it to show in the display box. According to Firefox's DOM Inspector it looks like the iimPlay() error box is closed by calling mainwindow.iMacros.panel.mboxClose();, but I can't control the iMacros panel from my js file, can I?
chivracq
Posts: 8636
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can I use javascript to hide a visible iimDisplay messag

Post by chivracq » Tue Feb 11, 2014 10:12 pm

Your original Question was about not knowing for sure if the iimPlay() msg displayed in the green Panel came from the previous Run or the current one, I think that putting standard an iimDisplay() msg at the Beginning of your Script and at the End + Error in case, always gives you the info you wanted, and you could even add a few in the middle so that if your Script crashes somewhere, you already know roughly where...

Further, as mentioned in an other Thread with you, I don't use (yet) .js Scripts, so I haven't been able to experiment with and find the Limitations of all the "dedicated" Functionalities...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
sightunseen
Posts: 67
Joined: Fri Apr 19, 2013 4:54 am

Re: Can I use javascript to hide a visible iimDisplay messag

Post by sightunseen » Wed Feb 12, 2014 12:01 am

chivracq wrote:I don't use (yet) .js Scripts, so I haven't been able to experiment with and find the Limitations of all the "dedicated" Functionalities...
I understand you don't I thought maybe someone else here might. I appreciate your help in my threads though, thank you!
chivracq
Posts: 8636
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can I use javascript to hide a visible iimDisplay messag

Post by chivracq » Wed Feb 12, 2014 12:49 am

Ja-ja, Thread is of course still open for other people (and TechSupport) to react...

Thanks for the positive Feedback btw...

Any chance for a Reply from you in your "Unresponsive .js Script" Thread, especially concerning a dedicated FF Profile for your iMacros Script...?

But I am currently maintaining 10.000+ Lines of Code in iim.Scripts, I will very soon switch to .js + .iim, you've kind of motivated me, big rewrite for me, but after that, I will end up with only 3000-4000 Lines of Code to maintain, as many Block are several times du/tri/quatro/etc/(com)plicated...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
rstancuna
Posts: 23
Joined: Sun Jun 16, 2019 10:27 pm

Re: Can I use javascript to hide a visible iimDisplay message?

Post by rstancuna » Sun Jun 16, 2019 10:49 pm

Firefox 55, iMacros V8.9.7, Windows

Looked for a long time for a way to hide iimDisplay in javascript.

In your js code, just run another macro at the end. The macro can be empty, just needs to run that other file (the other%5C part is because I have the macro in a folder name other):

Code: Select all

iimPlay("CODE: URL GOTO=imacros://run/?m=other%5Cremovedisplay.js");
Since I use it in several places and wanted to have a timeout before the display is hidden without having to enter WAIT SECONDS all the time before it, I made a nice function:

Code: Select all

function hidedisplay(timeout){
	if (timeout !== undefined && timeout.toString().match(/\d/)){
		iimPlay("CODE:WAIT SECONDS="+timeout.toString());
	}
	iimPlay("CODE: URL GOTO=imacros://run/?m=other%5Cremovedisplay.js");
}
The function allows to enter a timeout with or without quotes ( hidedisplay(1.5) or hidedisplay("1.5") ) or you can leave it blank ( hidedisplay() ) for no timeout.
Waterfox 56.2, iMacros V8.9.7 on Windows
Post Reply