Master Script: use strict; use warnings; my $cmd1="C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Accesso +ries/Calculator.lnk"; my $generatorDir = "c:/perl/perl_tests"; my @rprtname = ("gui_calci"); my $rpcount=0; foreach(@rprtname) { my $rptscript = $rprtname[$rpcount]; system ("perl $generatorDir/$rptscript.pl")and die"error running $rpts +cript.pl $?" ; $rpcount++ }
gui_calci Script: use Win32::GuiTest qw(:ALL); use strict; system($cmd1); my @window=FindWindowLike(undef,"Calculator"); if(!@window) { die("cannot find window with title/caption Calculator\n"); } else { printf("window handle of Calculaotr is %x \n",$window[0]); } EnableWindow($window[0],1); PushChildButton($window[0],132); sleep 2; PushChildButton($window[0],93); sleep 2; PushChildButton($window[0],135); sleep 2; PushChildButton($window[0],121); sleep 2;

When I try to pass file path of calculator in master file itself my script does not work while when I pass it in gui_calci script it works fine. how can I pass file paths in the master script itself???


In reply to How to pass file paths in a master script which is used to run several perl scripts? by ankit.tayal560

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.