Script Question

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Script Question

Post by rlmentz »

Hello,
Is it possible for the DWS script language to send a control key combination to a program?
Example
1. enable a pop up that asks (yes or no) if the person even wants this script to continue. If no then end, if yes then continue
2. Run a program
3. send the key combination of Control F2.
4. paste the call information (phone number in XXX-XXX-XXXX fomat)
5. send enter key

We have a database program which uses the control F2 key combo to envoke a search by phone number. I know nothing about the scripting language DWS, and have spent several days on the internet trying to learn about the language, but have not been able to duplicate the steps above.
Any tips or ideas would be appreciated.

Thank you very much
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Script Question

Post by Bill Root »

rlmentz wrote:Is it possible for the DWS script language to send a control key combination to a program?
At this time, no, or not directly, at least. You could certainly start another program that sends the keystroke.
Example
1. enable a pop up that asks (yes or no) if the person even wants this script to continue. If no then end, if yes then continue
2. Run a program
3. send the key combination of Control F2.
4. paste the call information (phone number in XXX-XXX-XXXX fomat)
5. send enter key
At this time Ascendis Caller ID also has no way to prompt the user from a script. This gets a little more complicated when done from a program that communicates with devices in real time.

The best solution would involve a command-line, COM, or even HTTP interface to your database program. If none are available, a macro solution like you suggested may work in most situations.

I recommend trying AutoHotkey, which is free and open source:
http://www.autohotkey.com/

In that case, you could use an AutoHotKey script similar to this:

Code: Select all

; DbLookup.ahk 
;
; - start database program and search for phone number passed on command line
;
; 05/14/08 WTR - created

; activate or start database program
IfWinExist MyDatabaseProgram
  WinActivate
else
  ; may need to add path
  Run MyDatabaseProgram

; send Control-F2
Send ^{F2}
; send phone number to lookup (passed as argument to this script)
Send %1%
; start search
Send {Enter}
(This script does not prompt the user before searching. This can be using the AutoHotKey MsgBox comand, and IfMsgBox.)

You would need to run the AutoHotKey script from Ascendis Caller ID. This is most easily done from an Easy action by specifying the full script path and name on the "Run" page. Be sure to type "{Number}" in the "Arguments" box to pass the phone number to the AutoHotKey script.

Finest regards,
Bill Root
Ascendis Software
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

Thank you, I LOVE open source programs. I will give this a try.

Thanks again!
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

OK, I have started exporting all our accounts to an HTML spreadsheet. All phone numbers and their associated account numbers are in this file. Is it possible to have the script in the Caller ID software search for the phone number in this file and display the associated account number?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Post by Bill Root »

To clarify, it sounds like you want Ascendis Caller ID to lookup a phone number in your HTML file when a call comes in and display the associated account number. Technically I think this could be done but the account number won't be displayed in the ACID display panel (the blue area where the phone number and name are normally displayed). You could display the account number in a message window. However, the code to lookup the account number would have to be manually written, unless you used a separate program to lookup and display the account number. Also, for anything but a small data file, the lookup time could be unpleasant.

Another option is to use one of ACID's custom contact fields to store the account number. Then the next beta version could be used to display the custom field in the display panel with the other contact information. (The current beta version does not allow access to the custom fields from a script, but the next one will.)

If you can convert your HTML file to CSV, you can have ACID automatically import the file when it changes using the File->Import->Auto Import Contacts command.

If I misunderstood what you're trying to do, please clarify. If you need help implementing one of the above solutions, just ask.

Finest regards,
Bill Root
Ascendis Software
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

This is exactly what I am wanting to do, and before I publish the html file, it starts as a csv. Each account can have up to 9 numbers associated with it and each one needs to be searched to match the incoming number. Will ACID import that many phone numbers?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Post by Bill Root »

Yes, it will. Your CSV file should look something like this:

Code: Select all

FirstName,LastName,Number,Custom1
John,Smith,8881111234,1234567890
John,Smith,8881112345,1234567890
John,Smith,8881113456,1234567890
John,Smith,8881114567,1234567890
John,Smith,8881115678,1234567890
John,Smith,8881116789,1234567890
You may want to enable the "Overwrite existing contacts with values from import file" option in the "Auto Import Contacts" window. Otherwise contact fields will be ignored if the contact already exists. The downside is that each import will overwrite any contact changes made using ACID. In other words, when an overwrite occurs all contact data is replaced from the import file, not just fields that appear in the import file. Note that new phone numbers, even for existing contacts, will be added in either case.

Finest regards,
Bill Root
Ascendis Software
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

Thanks for the help Bill. One last question, If i load all the contacts on the server machine. Will it pass the contact information over the network to the client machines?
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Post by Bill Root »

Yes, Ascendis Caller ID server will pass the contact information to the clients. However, if the client already knows about the contact, the client ignores the contact information.

If a client already knows some of the contacts and you want the client to match the server, it's best to start afresh by backing up the server database and restoring it on the client.

Finest regards,
Bill Root
Ascendis Software
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

Yes, I see its passing the contact information to the clients now. Is there a way to keep the client machines from storing the contact information, and only displaying what the server sends, or is that how the system is designed to work.
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Post by Bill Root »

No, you can't tell the client not to store the information. It only displays and acts on data in the local database.

However, I did add an advanced client option to overwrite the local contact when one is received from the server. I think this will do what you need. The change will be included in the next beta release.

Finest regards,
Bill Root
Ascendis Software
rlmentz
Posts: 15
Joined: Mon May 05, 2008 9:12 pm

Post by rlmentz »

Bill,
You have been such a big help, thank you very much, and I apologize for all the questions. I think I have one last question. I used the name field to load the account number of the contact, that way it displays the account number instead of the name and added the Raw Name field into the list to see the actual caller id name information. When I right click on the name in the calls tab and say copy call info, Can I change it so it copies the raw name, instead of the contact name (which is the account number)?

Thanks again.
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Post by Bill Root »

Sorry, there's no way to change what gets copied for the various copy commands. You could add the raw name field to the display script, and then you can double-click it, right-click, and choose "Copy Selected Text".

Or, you can use the "Copy Clicked Cell" command from the grid right-click menus in the next beta version.

Finest regards,
Bill Root
Ascendis Software
Post Reply