Announcement

Collapse
No announcement yet.

How to access Address Book

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access Address Book

    looking for a way (scripting) to access the contact class to check a phone # ?

    I can't seem to find the examples...

    Thanks
    Don

  • #2
    Hi Don,

    I have some scripts that I can post tonight. I use it to retrieve names associated with a phone number. What are you trying to do?

    Cheers
    Al
    HS 3.0.0.532: 1963 Devices 1141 Events
    Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

    Comment


    • #3
      I have a PBX that generates a number w/ an incoming call. Rich never fixed HSPhone's setting problems, so I'm using this to write to and pull data from the contact list.

      Would love to see your code....
      Don

      Comment


      • #4
        Hi Don,

        Here's a code snippet from a script that creates a log of the last 10 callers. It finds a phone number (defined as the variable Phone)in the callers log and then looks in the HSPhone address list to find a match and then sets a variable called Caller with the name.

        Code:
        adr_count = hsp.ADRCount
        For i = 1 To adr_count
        	Set contact = hsp.ADRGet(i)
        	If Phone = Trim(contact.home_phone) or Phone = Trim(contact.home_phone_2) or Phone = Trim(contact.cell_phone) or Phone = Trim(contact.cell_phone_2) or Phone = Trim(contact.business_phone) or Phone = Trim(contact.business_phone_2) Then
        		If contact.first <> "" Then
        			Caller = contact.first & " " & contact.last
        		ElseIf contact.company_name <> ""  Then
        			Caller = contact.company_name
        		Else
        			Caller = Phone
        		End If
        	End If
        Next
        Note that this is from a vbscript script and may need a bit of modification to work in vb.

        Hope that helps. Let me know if you have any questions.

        Cheers
        Al
        HS 3.0.0.532: 1963 Devices 1141 Events
        Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

        Comment


        • #5
          Thanks. That helps.
          Don

          Comment

          Working...
          X