At 9:59 -0400 2000.09.27, Eric Rainey wrote: >I've given up on $browser->print(filepath) in NN and IE 4.5, they >just don't seem to work right, oh well. Again, it worked for me in Netscape Communicator 4.75. Dunno why. >$browser->print works OK in IE 5, (i've only tried it for one file, >though), but I still have to click the OK in print dialog. Anyway >around this? Yes. I don't know what it is, but there is a scripting addition that can dismiss dialog windows. >for my $winder(@windows) { > > $IE->printbrowserwindow($winder); > > die ("nope! $^E") if ($^E); > >} > >And it does load up all the pages fine, but nothing prints, and I get >this error: > ># # nope! Error in parameter list / Not an existing volume, and no >default volume / Bad positioning information / Bad drive number (OS >error -50), <IN> chunk 1. >File 'Pulp:werken:projects:masterpiece:db :applescript:printem.pl'; Line 43 Well, this works for me: #!perl -wl use URI; use Mac::Glue; use strict; my $ie = new Mac::Glue 'Internet Explorer'; $ie->ERRORS(sub { my @err = @_; die "$err[2]\-\>$err[3](@err[6..$#err]) error $err[5]: $err[4]\n"; }); $ie->closeallwindows; for my $file (map { new URI "Bourque:Desktop Folder:$_.html" } qw(a b)) { $file =~ s/:/\//g; $ie->openurl("file:///$file", towindow => 0); } $ie->activate; my @windows = $ie->listwindows; for my $window (@windows) { $ie->printbrowserwindow($window); } Note that if I don't put in $ie->activate, I get the same error you get: # Internet Explorer->printbrowserwindow(DOBJ 165) error -50: Error in parameter list / Not an existing volume, and no default volume / Bad positioning information / Bad drive number (OS error -50) I am guessing IE wants to be in front when you do this. >Which, incidentally, is the same error I get were I to try to print >each window immediately after opening it. I'm guessing that perhaps >this error is being generated because the page isn't yet done loading >before it's trying to print; is there any way to cause either the >script or IE to wait until the page is done loading before trying to >print? (Short of course an actual sleep() call, which is eventually >doomed to failure and inefficiency). Maybe it is the same thing; IE wants to be in front. I don't think the page has yet to load in. I put a sleep(5) in and still got the same error. Just call activate() and see if it works. -- Chris Nandor pudge@pobox.com http://pudge.net/ Open Source Development Network pudge@osdn.com http://osdn.com/ # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org