Example JS .html doesnt start iim

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
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
JonnyDee
Posts: 17
Joined: Tue Jun 10, 2014 4:51 pm

Example JS .html doesnt start iim

Post by JonnyDee » Tue Jun 10, 2014 5:18 pm

Copied the code from here
http://wiki.imacros.net/JavaScript

Code: Select all

<html>
 <body> 
  
 <script type="text/javascript">
   <!--
   function runimacros() {
      var iim1 = new ActiveXObject("imacros");
      var iret
   
      iret = iim1.iimInit("-fx");
      iret = iim1.iimDisplay("This is a test");
      iret = iim1.iimPlay ("JS_TEST");
      iret = iim1.iimExit();
   }
   //-->
  </script>

 <a href="javascript:runimacros()">Click to run iMacros</font></a>
 </body>
 </html>
with notepad, as iopus_code.html save to macros default folder. Only change is substituting my own .iim (which runs correctly in the iMacrows IE browser)

1. clicking on the iopus_code.html file it runs in IE11. After taking care of the Action Script popups I 'click to run imacros' and get nothing
2. rt clk iopus_code.html to run in iMacros, and only see the default opening page
3. running the iim from iMacros browser sidebar generates the correct PROMPT dialogue over the opening page (as I expected)
4. substituting the full path for the iim in the html makes no change

I am stumped. This is my first attempt to use javascript with iMacros. I have had good success with Imacros on its own.
Any suggestion/fix really appreciated!

The iim:

Code: Select all

    VERSION BUILD=9002379 RECORDER=FX
    TAB T=1
    TAB CLOSEALLOTHERS 
    SET !ERRORIGNORE NO
    SET !EXTRACT_TEST_POPUP NO
    'FILTER TYPE=IMAGES STATUS=ON
' CLEAR page load takes longer than 15 seconds
    SET !TIMEOUT_PAGE 15
    CLEAR
    SET !EXTRACT NULL
    SET testCANADA Canada
    PROMPT Does<SP>this<SP>{{testCANADA}}<SP>===<SP>Canada?

Config:
Windows 7 N 32bit Ultimate SP1 (&& all updates installed as of last week)
default browser : IE 11.0.7 (&& all updates installed as of last week)
iMacros browser : 9.00.2379
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Example JS .html doesnt start iim

Post by chivracq » Tue Jun 10, 2014 9:08 pm

My 2ct... (I don't use that Functionality...):

- "iimInit("-fx")" is to start an Instance of Firefox... You don't mention anything about FF in your Config Info, do you have FF installed...?
- Replace "-fx" with "-ie" otherwise if you want to run your .iim Macro in IE...
- According to the Wiki, 'iimInit()' uses 4 to 6 Parameters and you only have one.
- 'iimOpen()' replaced 'iimInit()', your Syntax with only one Parameter would then be OK with 'iimOpen()'...
- (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...
JonnyDee
Posts: 17
Joined: Tue Jun 10, 2014 4:51 pm

Re: Example JS .html doesnt start iim

Post by JonnyDee » Wed Jun 11, 2014 1:04 am

chivracq wrote:My 2ct... (I don't use that Functionality...):

- "iimInit("-fx")" is to start an Instance of Firefox... You don't mention anything about FF in your Config Info, do you have FF installed...?
- Replace "-fx" with "-ie" otherwise if you want to run your .iim Macro in IE...
- According to the Wiki, 'iimInit()' uses 4 to 6 Parameters and you only have one.
- 'iimOpen()' replaced 'iimInit()', your Syntax with only one Parameter would then be OK with 'iimOpen()'...
Thanks so much for pointing out those errors .... I learned a lot in those few lines! :o :shock: :D
I hope the support guys see the thread ... lol ... how long ago was iimInit() officially retired?
I will no longer have the expectation that what I find in the support pages is anywhere near up to date ! :roll:
I will have to experiment to see if 'iimOpen()' has the ability to start the imacros browser,

Take care, and thanks again!

UPDATE_#1: Made some progress && changed the .html to this
More research :idea: :!: :? gets me this far:

Code: Select all

<html>
 <body> 
  
 <script type="text/javascript">
   <!--
   function runimacros() {
      var iim1 = new ActiveXObject("imacros");
      var iret
      iret = iim1.iimOpen();
      iret = iim1.iimDisplay("This is a test", 120);
      iret = iim1.iimPlay("JS_TEST");
      iret = iim1.iimDisplay("Ran that test", 120);
      iret = iim1.iimGetErrorText();
      iret = iim1.iimClose();
   }
   //-->
  </script>

 <a href="javascript:runimacros()">Click to run iMacros</font></a>
 </body>
 </html>
with :: iret = iim1.iimOpen();
IE11 opens with the same 'click to run... ' ... but now ... iMacros browser opens for about a second, and then closes ...
there is PROMPT in the iim code so I was hoping that would hold it open

with :: iret = iim1.iimOpen("-ie");
IE11 opens with the same 'click to run... ' ... but now there is also 'starting imacros scripting interface .. ' but that is all

this is setting recommended for IE10 + IE11 :: iret = iim1.iimOpen("-ie_ext");
IE11 opens with the same 'click to run... ' ... but now it crashes .. strange that the specific parameter for IE11 actually makes it crash :evil: :shock: :roll:

No errors displayed.

Error report in the iMacro logs:
2014-06-11 04:06:09Z
iMacros Sidebar version 9.0.0.2379, IE version 11.0.9600.17041, OS version Microsoft Windows NT 6.1.7601 Service Pack 1


Exception at IntPtr #=qauC52VVKmrEUwWmRCm4svfQ59D_q2tqepXCg9szfM7M=(IntPtr)
Specified method is not supported


Hopefully someone at support will post here for: I have run out of ideas for now.
Last edited by JonnyDee on Wed Jun 11, 2014 12:02 pm, edited 1 time in total.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Example JS .html doesnt start iim

Post by chivracq » Wed Jun 11, 2014 7:41 am

JonnyDee wrote:Thanks so much for pointing out those errors .... I learned a lot in those few lines! :o :shock: :D
I hope the support guys see the thread ... lol ... how long ago was iimInit() officially retired?
I will no longer have the expectation that what I find in the support pages is anywhere near up to date ! :roll:
I will have to experiment to see if 'iimOpen()' has the ability to start the imacros browser,
- OK, good that you've come further. I was not really pointing out Errors as I don't have the Scripting Interface and have never played with it, so I was more merely giving some Suggestions about things I would try myself after reading the wiki...
- 'iimInit()' has been replaced and simplified by 'iimOpen()' but it's still supposed to be working for Backward Compatibility (with the correct number of Arguments...)...
- Yep, happens regularly that Wiki Pages are outdated and when Errors are found, they don't always get corrected..., though in your case, you were kind of "lucky" as both Pages referred to each other...
- For the Prompt not being displayed in one case, I would try to make your .iim Macro a bit longer by navigating to 1-2-3 Pages so that you can see for sure if it is running.
- About the Crash on IE11, you are using the iMacros Browser (and the Scripting Interface) v9.x which came out for IE10, maybe you should try (on some other PC with a fresh Install) with the iMacros Browser (Enterprise (Trial)) v10.x to see if it makes a difference with IE11...
- (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...
JonnyDee
Posts: 17
Joined: Tue Jun 10, 2014 4:51 pm

!SOLVED! Re: Example JS .html doesnt start iim

Post by JonnyDee » Wed Jun 11, 2014 1:11 pm

chivracq wrote: - For the Prompt not being displayed in one case, I would try to make your .iim Macro a bit longer by navigating to 1-2-3 Pages so that you can see for sure if it is running.
TYVM!

I took the suggestion, and cant understand WHY it made a difference: :shock: :o :lol:
IE11 still opens first with the active script warning, but I still dont see the iimDisplay() doing its job :!: :!: :?: :x
and then iMacros runs the iim correctly, and closes (dancing my happy dance) :D :D :D

A perfect way to start this day ...

Be well, and thanks again chivracq ! :D
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Example JS .html doesnt start iim

Post by chivracq » Wed Jun 11, 2014 2:47 pm

Good, glad I could help... :D
- (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...
Post Reply