EddieL Posted November 9, 2019 Share Posted November 9, 2019 Hi All I am totally new to AutoIt, trying it for the first time after watching twenty tutorial videos. I need to capture an incoming telephone number on Zoiper Biz so that it can be used by an Ms Access database to retrieve the customer details. However, I cannot make AutoIt read from the window. I have attached a photo of the window when a call comes in, but I am trying various ways of capturing the text, but all result in an empty variable. My code is: $PhoneDetails = ControlGetText("Incoming Call", "", 200454) $ExtraDetails = ControlGetText("Incoming Call", "", "CLASS:TSecuraxGroupBox.UnicodeClass; INSTANCE:1") $TelNo = StringLeft($PhoneDetails, 11) ConsoleWrite("Phone Details: " & $PhoneDetails & @CRLF) ConsoleWrite("Phone Number: " & $TelNo & @CRLF) ConsoleWrite("Phone Number: " & $ExtraDetails & @CRLF) $TryAnotherWay = WinGetText("Incoming Call"ConsoleWrite("Another Way: " & $TryAnotherWay & @CRLF) It lists the text as: Ignore Reject Accept Caller I would be very grateful if anyone could help me please. Link to comment Share on other sites More sharing options...
BugFix Posted November 11, 2019 Share Posted November 11, 2019 The GroupBox includes a Label/Edit that holds the caller number. You need access to this control, not to the group. Best Regards BugFix Link to comment Share on other sites More sharing options...
EddieL Posted November 11, 2019 Author Share Posted November 11, 2019 Hi BugFix Thank you very much for trying to help me. Can I ask how you can tell there is a label Edit that holds the caller number? I am not arguing, just curious. $PhoneDetails = ControlGetText("Incoming call", "", "Edit") $TelNo = StringLeft($PhoneDetails, 11) ConsoleWrite("Phone Details: " & $PhoneDetails & @CRLF) ConsoleWrite("Phone Number: " & $TelNo & @CRLF) $TryAnotherWay = WinGetText("Incoming call") ConsoleWrite("Another Way: " & $TryAnotherWay & @CRLF) gives Phone Details: Phone Number: Another Way: Ignore Reject Accept Caller Any idea what else I am doing wrong please? Link to comment Share on other sites More sharing options...
EddieL Posted November 11, 2019 Author Share Posted November 11, 2019 Another strange thing is that I have used window info on the same control and it is now giving me a different response. >>>> Window <<<< Title: Incoming call Class: TIncomingCallReactionF.UnicodeClass Position: 935, 474 Size: 355, 99 Style: 0x96C00000 ExStyle: 0x00010101 Handle: 0x000E1270 >>>> Control <<<< Class: SysListView32 Instance: 1 ClassnameNN: SysListView321 Name: Advanced (Class): [CLASS:SysListView32; INSTANCE:1] ID: 265622 Text: Caller Position: 0, 0 Size: 349, 38 ControlClick Coords: 94, 27 Style: 0x56000000 ExStyle: 0x00010000 Handle: 0x00040D96 >>>> Mouse <<<< Position: 1032, 527 Cursor ID: 0 Color: 0x5199ED >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Ignore Reject Accept Caller >>>> Hidden Text <<<< Link to comment Share on other sites More sharing options...
crackdonalds Posted November 11, 2019 Share Posted November 11, 2019 i wouldn't bother with the control reads. it is rarely useful. kinda depends on how the GUI is made. I would read the text from the memory instead. It might get a bit complex though. Link to comment Share on other sites More sharing options...
TheXman Posted November 11, 2019 Share Posted November 11, 2019 On 11/9/2019 at 5:11 PM, EddieL said: I need to capture an incoming telephone number on Zoiper Biz so that it can be used by an Ms Access database to retrieve the customer details. Why don't you use the Zoiper COM API? That is what it is for. From the Zoiper site: Quote Zoiper COM API is designed for use with programming languages, capable to connect to OLE Automation servers. Its purpose is to provide control over Zoiper functions and events, so it could be embedded in other applications. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
EddieL Posted November 11, 2019 Author Share Posted November 11, 2019 Hi TheXman I have tried using the Zoiper API. The link to the Zoiper API for this version of Zoiper is https://www.zoiper.com/downloads/documentation/Zoiper_API_Documentation.pdf. I can dial a number from the database using the API and I can answer a call with the API, but the only mention it makes of the incoming caller id is in a line state change event. I have tried to access OnLIneStateEvent but this is an event handler and I have no idea how to do that from vba. Every time I try to reference it I get "Object does not support this method or property". I tried asking Zoiper but they said their support does not extend to development. Link to comment Share on other sites More sharing options...
TheXman Posted November 11, 2019 Share Posted November 11, 2019 4 minutes ago, EddieL said: I have no idea how to do that from vba. What does VBA have to do with anything? You are aware that this is an AutoIt forum, correct? Your last post is made up a statements. Do you have a question, more specifically, an AutoIt-related question? CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
EddieL Posted November 11, 2019 Author Share Posted November 11, 2019 The question is in my original post. VBA comes into it as I am controlling this whole process from a Microsoft Access database. AutoIt seemed a great way to read the incoming caller id as I cannot do it any other way that I know of. Link to comment Share on other sites More sharing options...
TheXman Posted November 11, 2019 Share Posted November 11, 2019 (edited) I agree that AutoIt may be a great way to get incoming call information, but only as it relates to using the Zoiper COM API. Since I have no idea what your environment looks like, your proficiency with VBA or general coding abilities, and how you are driving this process using MS Access, it is hard to offer much advice. Are you trying to use AutoItX in MS Access or or you launching an AutoIt script and somehow passing information back to your MS Access DB? Given the terse snippet that you supplied, I'm unable to tell. If you are just interested in some direction as to where to begin, if it were me, I would use an AutoIt script, that implements the Zopier COM API, and registers to receive the Zopier COM events using the AutoIt ObjEvent() function. Which event I would be interested in depends on whether you want information on all incoming calls (OnZoiperCallIncoming) or only accepted calls (OnZoiperCallAccepted). Both events pass a Call object. That object includes a Phone property that has the phone number. Of course you could do all of this using straight VBA code too. Edited November 11, 2019 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now