Jump to content

Copying from a program without mousemove


Recommended Posts

Hello all,

I'm new to scripting in autoit. I've taken time to study the help file and search the forums but have been unable to come up with a solution which I'm sure is quite simple. I'm looking for a way for autoit to pick a certain field in a program and copy this field. As you can see in the picture there are numerous fields. The field I'm interested in is the space beside "AcctNum:" where the account numbers go(000813914 in this example). Can someone point me in the correct direction or tell me what's the best route to script it so autoit will copy that number every time I run the script? The reason I do not want to use mousemove is because the different employees here set their screen up differently, which means using coordinates to tell the script where to click wouldn't be effective. Sorry for all of the white space in the picture.

Posted Image

Thanks,

Mackeo

Link to comment
Share on other sites

If you can select the account number, there is a command for ClipPut() to copy selected to clipboard and ClipGet() to get item from clipboard.

Maybe through creative use of ControlClick() or ControlSend() you can get the account number selected.

(You can use the built in "AutoIt Window Info" tool to see if you can interact with the window using the control functions)

*edit*

I just noticed that this is actually in a browser window, see IE Management in the helpfile :)

(even though you are using google chrome, you may still get use out of the IE functions, also Inet Management might help.)

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

Ok, so after testing with _IE Management I've been unsuccessful in completing this task. Here is the source code of the program that I want to pull the info out of. (Sorry for this being large). Again, with every account that's loaded the account number will change. How would I go about ensuring autoit pulls the correct value every time?

<meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" type="text/css" href="../runtime/agentpanel/screenpoppanel.css"></link>  
 
        <style type="text/css">
                .displayName {white-space : normal; overflow: visible; width: 90px;}
                .keyValue {white-space : normal; overflow: visible; cursor:auto;}
        </style>
 
  </head>
    <body  style="" onload="parent.resizeIframe(document.body.scrollHeight); parent.resizeWindow();" >
        
        <div id="liquid-round">
            <div class="top"><span></span></div>
            <div class="center-content">        
                <table width="241px">
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">AcctNum</span>:</td>
                        <td><span class="keyValue">000813914</span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Client</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Debtor01</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Originator</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Debtor02</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Status</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Connected to Phone No</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Total Due</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">Last Activity</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                    <tr>
                        <td style="white-space : normal; overflow: visible; width: 140px;"><span class="displayName">LPDate</span>:</td>
                        <td><span class="keyValue"></span>
                        </td>
                    </tr>
        
                </table>
            </div>
            <div class="bottom"><span></span></div>
        </div>          
  </body>
</html>
Link to comment
Share on other sites

I believe _INetGetSource() should pull up that information you posted, so using a StringRegExp() should be able to find the Word "Account" followed by class="keyValue"> and copy the numbers dirrectly after that.

Unfortunately, I'm not very good with StringRegExp yet :)

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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...