Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to use menu options

by marto (Cardinal)
on Nov 10, 2016 at 09:48 UTC ( [id://1175665]=note: print w/replies, xml ) Need Help??


in reply to How to use menu options

I don't think your example does what you think it's doing. You don't check @window, I believe this will be undef, so the remainder or your code won't work as expected. You need to start error checking and basic debugging. Consider the following, your call to FindWindowLike is wrong. Assuming things work isn't wise.

use strict; use warnings; use Win32::GuiTest qw(:ALL); my @window = FindWindowLike(undef, "Excel"); # die if Excel can't be found if (not @window) { die "Could not find Excel\n"; } # do stuff here

Corion is wise to suggest sending hotkeys, since you seem to want to persist on driving things via a menu I'll once again point you to the module documentation which explains this and has example code for dumping menus Win32::GuiTest/Win32::GuiTest::Examples. Also Tutorials/Debugging and Optimization. You could launch excel and open a file (you've been given lots of help on starting apps previously).

Update: slight rewording for clarity.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175665]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-03-28 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found