problem running Macro Scheduler on windows vista

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

problem running Macro Scheduler on windows vista

Post by pneves » Mon Jan 25, 2010 12:05 pm

I am running version 10.1.21.
I have the following code:

Code: Select all

   // Open IE
   LibFunc>%hIE%,CreateIE,IE[0],0
  
   // Open BPI site for companies
   LibFunc>hIE,Navigate,r,%IE[0]%,https://www.bpinetempresas.pt/SIGNON/signon.asp
   LibFunc>hIE,WaitIE,r,%IE[0]%
   Wait>delay
   WindowAction>1,BPI Net*
   Wait>delay

    Let>HTML0_SIZE=40098
    Let>_DUMP_VARS=1
    IE_ExtractTag>%IE[0]%,,HTML,0,1,HTML0,r
    MidStr>r_6,1,r,HTML0
    \\IE_ExtractTag>%IE[0]%,,BODY,0,1,BODY0,r
    \\MidStr>r_6,1,r,BODY0
    Let>_DUMP_VARS=0
    DeleteFile>C:\data\log.txt
    WriteLn>C:\data\log.txt,e,%HTML0%   
    WriteLn>C:\data\log.txt,e,HTML_File1
    WriteLn>C:\data\log.txt,e,%r_6%   

On Windows Xp I correctly get the webpage Html.
On windows Vista I get the following text on the log.txt file:

Code: Select all

  
HTML_File1
%r_6%   


What could be the problem.
I am running the exact same script that is located on a shared drive (samba).

Thanks,

Pedro

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jan 25, 2010 4:38 pm

I don't see any reason why that wouldn't work. But have you disabled IE's "Protected Mode" which was introduced with Vista? Protected Mode prevents IE from being scripted.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

Post by pneves » Tue Jan 26, 2010 10:49 am

That is not the problem.
I don't even have UAC enabled.

Let>HTML0_SIZE=400098
IE_ExtractTag>%IE[0]%,main,HTML,0,1,HTML0,r
MidStr>r_6,1,r,HTML0
WriteLn>%DataFileLog%,e,HTML_File_1
WriteLn>%DataFileLog%,e,%r_6%

One question, why do we use r_6 variable ?
Shouldn't we be using HTML0 ?

What is IE_ExtractTag doing ?
I thought it would:
- return the html/text in the var HTML0
- return the HTML0 size in r
- what about r_6 ??

Thanks,

Pedro

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 26, 2010 12:22 pm

IE_ExtractTag works fine for me on Vista and Win7 and I have UAC enabled.

The IE_ functions are import wrappers around LibFunc functions. r_6 relates to the 6th parameter in the LibFunc call, which is the return buffer in this instance. For a more detailed understanding see the help file topic for LibFunc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

Post by pneves » Thu Jan 28, 2010 9:14 pm

I am getting confused now.
Now even on XP just works when I open MacroScheduler and select "Run Now".
When I create the Exe and run it , the sript does not work.
Any ideas ?

By not working I mean:

With this code:

Code: Select all

    // Get Html
    Let>BODY0_SIZE=40098
    IE_ExtractTag>%IE[0]%,,BODY,0,1,BODY0,r
    MidStr>r_6,1,r,BODY0
    WriteLn>%DataFileLog%,e,HTML_File_%z% 
    WriteLn>%DataFileLog%,e,%r_6%
The only thing I get is this:

Code: Select all

HTML_File_1 
0 
HTML_File_2 
0 
HTML_File_3 
0 
%r_6% is returning "0"

With this code:

Code: Select all

    // Get csv
    IE_ExtractTable>%IE[0]%,,19,%DataFile%%z%.csv,1,r
The cvs file is not created.

pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

Post by pneves » Thu Jan 28, 2010 9:18 pm

It is ok to do this :

Code: Select all

  LibFunc>hIE,Navigate,r,%IE[0]%,https://www.bpinetempresas.pt/SIGNON/signon.asp
  LibFunc>hIE,WaitIE,r,%IE[0]%

  ... do some stuff

LibFunc>hIE,Navigate,r,%IE[0]%,https://www.bpinetempresas.pt/operacoes/consultas/movimentos/movimentos.asp
LibFunc>hIE,WaitIE,r,%IE[0]%

    // Get csv
    IE_ExtractTable>%IE[0]%,,19,%DataFile%%z%.csv,1,r
    
    // Get Html
    Let>BODY0_SIZE=40098
    IE_ExtractTag>%IE[0]%,,BODY,0,1,BODY0,r
    MidStr>r_6,1,r,BODY0
    WriteLn>%DataFileLog%,e,HTML_File_%z% 
    WriteLn>%DataFileLog%,e,%r_6% 

?

I mean, can I use the navigate command twice correct ?

LibFunc>hIE,Navigate,r,%IE[0]%,https:\xxxx
LibFunc>hIE,Navigate,r,%IE[0]%,https:\yyyy

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 28, 2010 9:27 pm

Have you copied the Imports folder containing IEAuto.DLL and IEAuto.INI from the Macro Scheduler program folder to the compiled macro's folder?

Yes, you can do two navigates in a row if you wish.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

Post by pneves » Thu Jan 28, 2010 10:06 pm

That is not the problem.
I just copied those files over the old ones. But it did not make a difference.

I will keep trying news ways to solve this.
Any ideas are apreciated.

Pedro

pneves
Newbie
Posts: 19
Joined: Mon Jan 25, 2010 10:59 am

Post by pneves » Thu Jan 28, 2010 11:58 pm

That was it Marcus!

I don't know why but on my vista machine this directory
C:\Program Files\Macro Scheduler\imports\
was not created:
I just created it and copy the following files:
C:\Program Files\Macro Scheduler\imports\IEAuto.dll
C:\Program Files\Macro Scheduler\imports\IEAuto.ini


The EXE was not working because of the same problem.
Before I had the following files:
C:\data\prog01.exe
C:\data\IEAuto.dll
C:\data\IEAuto.ini
and it did not work.
Now I have the following:
C:\data\prog01.exe
C:\data\imports\IEAuto.dll
C:\data\imports\IEAuto.ini
and it works !!

Thanks a lot for you great support !!

Pedro

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts