Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aspect Code Help 2

Status
Not open for further replies.

p514jl

Technical User
Dec 16, 2002
3
US
Please excuse my ignorance in advance as I am a VERY new user of Aspect Scripting.
I program telephone systems from scratch and would like to take a Microsoft Word or Excel spreadsheet and use the ext's and names field to add to a specific form in the program.
I have crudely programmed a script which with pauses i can add ext numbers and the script waits while i add the ext in place.
I would like to create a document once and have the script read it and execute it into the system.
i.e. read a column and input the data into a specific line.
all help is greatly appreaciated. Here is my crude script.


;Multiline Keys Assignment for 4025 and 4150 Sets (14 Keys)

proc main
transmit "^[1"
pause 1
; Key 2 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
; Key 3 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 4 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 5 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 6 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 7 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 8 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 9 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 10 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 11 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 12 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 13 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
; Key 14 String
;Column 1
transmit "^I"
;Column 2
transmit "^I"
;Column 3
transmit "^I"
pause 1
;Save and Exit Program
transmit "^["
transmit "4"
transmit "^["
transmit "1"
pause 2
;Ready to go again
transmit "^[Q"
endproc

I input values in the columns as needed and rerun script with a new ext. I would like to have it take a value from a document and enter it and run script and move to next ext .
Thanks in advance, Jim
 
The easiest thing to do is to first record a script using Procomm's Script Recorder, then replace the "real" data you sent with variables that will then be read from a text file, Excel spreadsheet, or what have you. Here is some info on the Script Recorder:

If you are trying to create a script that automates communications with a remote system and the text is relatively constant, you can make the task easier by using the Script Recorder to create your script. To enable the Script Recorder, select the Tools | Scripts | Start Recorder menu item. Procomm Plus will now monitor all incoming data and your outgoing responses to that data. Start performing the tasks (keyboard-based only!) that you want Procomm Plus to record. Once done, select the Tools | Scripts | Stop Recorder menu item. You will be prompted to save your recorded script; some editing of the script may be necessary. When you view your script, you will see that it is composed of waitfor/transmit commands. If all looks well, compile your script and see if it executes as expected.

Once you have the recorded script working fine, you'll just need to modify the script to read data from your file and change the transmit statements so they are sending the contents of variables instead of the hard coded values,
I have a couple examples on my site - - that show how to read data from text files that should get you started. There is also an example on the 4.8 CD that shows how to retrieve data from an Excel spreadsheet. aspect@aspectscripting.com
 
Is this on a 2K or a 200? We have a guy in our office that created a rough script using excel that put entries into the tel dir and multiline set form. I'll see if I can dig it up.

Simon
 
Thanks knob and Simon,
knob
i am trying to look through the manual with 4.8 but 700+ pages whew!!! I haven't made the part where they tell me how to import a list of data from excel or word, or increment my numbers by 1, but i'm reading. The recorder is how i got the basic srcipts i have already thanks though.
Simon it is on both.
I program 200 and 2k's and this would make both so much easier. If you find the script I could even use it as a guide if nothing else. Every little bit helps at this point. Thanks in advance for any help, Jim
 
Jim, I have not been able to track down that script my co wroker created, and of course he is on holidays until the new year. When he gets back I'll try to track it down.

Simon
 
Simon,
Thanks so much I'll look forward to hearing from you next year.
Till then all the season's best wishes.
Jim
 
Jim,
So I got the script that my coworker made up, but it was not what I thought. What he did was copy certain parts of his excel file into strings on his script. So it does not actually retreive info from excel. The only thing that excel is doing besides providing "the list" is concatenating all the variable into a giant string that includes tabs to get to the next field. then you take the string that excel created and insert that into your script. I thought that it was much more advanced, but I guess not.

So my next suggestion is to follow Knob's advice and use some example that are provided on the CD and on his site.


Simon
 
I've got a some script samples in VBA, where I take data from either a text file or excel spreadsheet, and build the aspect script from that. Let me know if you want to see some samples. It would probably be best if I just e-mailed them to you, they're quiet lengthy.

Kevin
 
Kevin, I would be interested in them as well to try and accomplish the same things that Jim is trying to do, so if you could fire them my way....

Simon.

simonthetallguy@yahoo.ca
 
I'll be submitting it to Knobs website later today (once I clean it up a little.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top