Portree has asked for the wisdom of the Perl Monks concerning the following question:

Hello All, I first want to say this site has been a tremendous help as I learn to use PERL and kind of hack my way to some automation. Thank you all for taking the time to post your questions and answers. A huge help for us newbies.

My question is in regards to using PERL to open Internet Explorer and then using IE to open a second program. The program I am running is called BRIO and the query that BRIO completes can only be run from an IE window. I have my code setup to open IE, and that works fine (found the code for that on this site), but then I am kind of stuck on how to have PERL open BRIO from the IE session. I have my code below, which I know is wrong, but can anyone out there help me. Thanks Portree

use strict; use Win32::OLE; my ($brio); #This is the location where my brio query is held on the server $brio = '//172.21.75.45/planning/logistics/programs/B_Chicago_wip_query.bqy' +; #Then open up a new IE session my $ie = Win32::OLE->new("InternetExplorer.Application") or die "Can't + start IE\n"; $ie->{visible} = 1; $ie->navigate("http://www.perlmonks.org"); #didn't seem to need this next piece, seems to work fine without it #while(1){ # $ie->Refresh(); # sleep 5*60; #} #Then try and use IE to open up the BRIO program $ie->open = ($brio)

Replies are listed 'Best First'.
Re: IE & File Open
by ikegami (Patriarch) on Jul 25, 2005 at 17:54 UTC
    I think it's simply
    use strict; use Win32::OLE; my ($brio); #This is the location where my brio query is held on the server $brio = '//172.21.75.45/planning/logistics/programs/B_Chicago_wip_quer +y.bqy'; #Then open up a new IE session my $ie = Win32::OLE->new("InternetExplorer.Application") or die "Can't start IE\n"; $ie->{visible} = 1; $ie->navigate($brio);

    By the way, the block you commented out refreshes the page every five minutes, forever. You probably don't need it.

      Hi ikegami

      Thank you, that worked perfectly. It now does exactely what I was looking for. Now, to my next question. To run a query I need to simulate from the new program that opened in the IE window the pressing of a button marked "Process". Any idea how to do that?

      An alternate is to go within the program and press "Tools => Process Query => Current" So, not sure which would be easier with PERL.

      Once again, I really appreciate the help. Thank you.
      Portree

        How about you read the documentation, particularly the click method. If you still have problems, show us what you tried.

        By the way, "Perl" refers to the language, "perl" refers to the program which runs Perl scripts, but there's nothing called "PERL".

        Hello All again,

        I have found the code

        $ie->click_button(%args)

        and I admit, I am not sure what to do with it. ikegami showed me a link and it shows this code for press_button, but I admit, I am not sure how to incorporate it into my script. The button that I want to press is titled "Process". I have tried all kind of variations on this. Any help is appreciated.

        Regards,
        Portree

Re: IE & File Open
by radiantmatrix (Parson) on Jul 25, 2005 at 18:15 UTC

    You should really read up on the mechanism you're using here. You have lines that display IE and then navigate to a site. You need to change the latter to navigate to the BRIO query you need to run.

    $ie->{visible} = 1; $ie->navigate($brio);
    <-radiant.matrix->
    Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law