Sign in to follow this  
Followers 0
Tobytja

Problem with Send and Mouse commands

8 posts in this topic

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

Share this post


Link to post
Share on other sites



Hi,

Without the files/softwares I can't really help you.

I advice you to debug your script as much as possible (ConsoleWrite, @error, return values, ...).

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hm, I see. Thank you, I have no idea why did I write that this way

Share this post


Link to post
Share on other sites

Hm, works when I try the script with less than 50 items, when the variable $issues_count is larger than some 50, the loop breaks at some point. I can't see a reason why

Share this post


Link to post
Share on other sites

See reply #2 and #3.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0