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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procomm Script Out Phones

Status
Not open for further replies.

abntelecom

Vendor
Jan 19, 2006
125
US
I'm looking for a procomm script that would out phone from txt file.
 
I have one that will out them from an excel file. As is, it starts on the second row (so you can have a header row) and then stops but you can change the first line "integer Ro =" to whatever row you want to start on and the begining on the loop "while Ro <" to the first row you want to NOT out.

Code:
[COLOR=red] integer Ro = 2		;* Starting row[/color]
 string TypeCell, TNCell
 string TypeVal, TNVal
 
   
Proc Main
  long LinkVar, SystemVar	;* Variables containing DDE Id's.
 
  if ddeinit SystemVar "excel" "system"
    ddeexecute SystemVar "[APP.MINIMIZE()]"	  ;* Minimize Excel
    if ddeinit LinkVar "excel" "sheet1"            ;* Link to Sheet 1
   
[COLOR=red]      While Ro < 3					  ;* first empty Row in Excel [/color]
  
        strfmt TypeCell "%s%d%s%d" "R" Ro "C" 1  ;*set address of cell holding the phone's type
        strfmt TNCell "%s%d%s%d" "R" Ro "C" 2  ;*set address of cell holding TN
    
        ;*** The following gathers the info
  
        Dderequest LinkVar TypeCell TypeVal
        Dderequest LinkVar TNCell TNVal

        ;*** Then out the phone

        transmit "out^M"
        waitfor "TYPE: "
        transmit TypeVal
        waitfor "TN   "
        transmit TNVal

        Ro++		 ;* Increment Row Number
      Endwhile
    Endif
  Endif
Endproc

The excel file must have the type of phone (3905, 3904 etc) in the first column and the TN in the second column. also the excel file MUST be open when you run the script and none of the phones can be acquired.

I didn't exactly come up with the whole thing but I've lost the name of the original scripts creator. I just adapted his script to send the info to procomm. It used to just throw the values of cells into a text file.

David I. Taylor
A+, Network+, MCP Windows XP
 
I just stumbled upon another script from the author of the one I used to create the one above. It's "Mark D. MacLachlan , The Spider's Parlor" who is markdmac here on TekTips

David I. Taylor
A+, Network+, MCP Windows XP
 
What about script that would change the des field for a list of tn's?
 
Just modify that one. If you need more fields then add more lines to get them
Code:
string newCell
string newVal

strfmt newCell "%s%d%s%d" "R" Ro "C" x
Dderequest LinkVar newCell newVal

x is the column number where the new info is in. To figure out how to do the rest just use the recorder to create a script that does it and copy that in place of my outting script.

come to think of it, if the script doesn't work when you do it for more than one you might just have to add
Code:
waitfor "REQ: "
before the end of the loop to make sure it doesn't try to send the next command too early.

Also keep in mind that using chg on an ACD phone is considered a very bad idea.

David I. Taylor
A+, Network+, MCP Windows XP
 
quickest way to change des either manually or with a script would be ld;s 84 and 85 wait for tn, transmit sting wait for des transmit string.. way quicker then ld 10 and 11

john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top