Jump to content

Problem with Send and Mouse commands


Recommended Posts

Hello,

I'm trying to create a script to automate some work. I encountered major problems I'm unable to solve. First step is to mark items in a table-like view of a software (space key marks the item, down arrow moves to next item in row). I first declare, how many items (called issues) I want to mark, and then run classical loop for the action. Sometimes it's about 2000 items and even if it is possible to mark them manually by using mouse, you must hold the mouse with left button pressed for about 2 minutes, which is quite pain in the ass :-) 

Here I encounter first problem, because usually the loop ends at some 600 or 700 issues and I can't figure out why. I first used While loop, then I tried For, but it's all the same.

Next problem is, that even if I select less issues, so that they are marked all before to loop breaks, they don't get copied to clipboard. That should be normally (manually) done either by right-clicking somewhere in the view and from drop-down menu select "copy selected as table" or by sending series of shortcuts (access menu by Alt+E, sending three down arrows, one right arrow, and pressing enter) I even tried ControlClick command, but also without success. If I have the issues in clipboard, rest of the script so far works OK. I attached the script itself to my post, so if someone is willing to help, why it doesn't work, please tell me :-)

If there are two semicolons at the beginning of the row, it means it's another way to do the task described above by regular comment.

Thank you very much

DeuBa progres report.au3

Link to comment
Share on other sites

To make your script more reliable I suggest to drop Mouse and Send commands and use Control* functions.

Can you try AutoIt Window Info Tool and check if you can get the ControlID of the CheckBoxes or whatever you need to mark?

A screenshot of the program you try to automate with the Window Info Tools output for a control would be helpful.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I made a screen shot of the Control of the software (IBM Lotus Notes), but I can't send screen shot of the Notes itself, since it may be considered a security violation, because the view would contain some internal informations. I tried this sequence, when I tried Control command to simulate it:

ControlClick("CIRATS v2 DeuBA IMT Germany - "&$cirats&" - IBM Lotus Notes","","[CLASS]:NotesLineView","secondary")

Send("{DOWN 5}{ENTER}")

If you manually right-click to the view, pop-up menu appears. Then when you press the down arrow 5 times and press enter (or left-click on a specific item in the menu - Copy selected as table), it makes the action I desire. But the script obviously didn't make the right-click or it ignored the pop-up menu that appears after the right-clicking. It's not possible to replace 5 downs + enter by MouseClick command, because I want the script to be usable by everyone in my team and everyone has different screen resolution (some are using old-fashioned 4:3 displays, some are using wide-screens, some are using laptops; I placed the taskbar to the left side of my screen, but most people have it at the default bottom location... So I can't determine for sure, where to click, since I don't know coordinations of the first right-click and therefore location of the pop-up menu). In case of using MouseClick command I used coordinations I know will be inside the view, since, as you can see, the view is pretty large and it's not such a big problem to determine a point, that will certainly be inside the view.

Unfortunately you'd have to be an IBM employee to fully test the script, since else you wouldn't be able to access the database used in the script even if you had the Notes. Is there some guide to debugging? My programming skills are very limited, I mainly only modify scripts I get from somewhere slightly (this is my first larger mainly independent project), and I can't find a section for debugging in official AutoIt documentation

post-80213-0-34799600-1370432634_thumb.j

Link to comment
Share on other sites

Without reading your whole post, I noticed a mistake in your code.

"[CLASS]:NotesLineView" ;wrong syntax
"[CLASS:NotesLineView]" ;ok
Edit: Please use autoit code tags.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...