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!

Connection directory convertion

Status
Not open for further replies.

frda

Technical User
Feb 14, 2002
25
BE
Hi,

I'm trying to write a script that automatically converts dialing directory's from pw2.11 to pw4.8, using the connection directory conversion tool.
Is there a way to detect when the tool has finished the conversion?

Thx.
Frank
 
I don't have a way to test this at the moment, but you could probably use the wintext command to get the dialog text from the active window (which would be the conversion utility), then see if it is the value displayed when the conversion is complete. Here is a sample script from the ASPECT help file to get you started:

proc main
string TextStr ; Title of the active window.

wintext $ACTIVEWIN TextStr ; Get title of active window.
usermsg "Active window title is `"%s`"." TextStr
endproc

aspect@aspectscripting.com
 
Hi Knob,

Thanks for your reply.
I tried what you sugested, but as there is nothing changing in the active window titlebar, this is not working, is there a way to retrieve the Convertion status messages?

Regards

Frank
 
Here's something I came up with this afternoon that does most of the work:

proc main
string sCmdLine

sCmdLine = $PWTASKPATH
strcat sCmdLine "\pwconvrt.exe"
run sCmdLine
pause 5
winactivate "Procomm Plus for Windows File Conversion Utility"
sendkeystr "c:\capnam.was"
sendkey ALT 'C'
pause 5
sendkeystr "`t"
sendkey CTRL 'C'
endproc

The first thing the script does is build the path to pwconvrt.exe, then launches the program. The pause 5 at the beginning is just to give time to switch focus from Procomm to the conversion utility. The file to convert is sent using the sendkeystr command, then Alt-C is sent to begin the conversion process. There is another five second pause to wait for the conversion to (hopefully) complete. After the conversion, focus is set to the Exit button. Sending one tab key sets focus to the results edit field. With this field conveniently highlighted for us, a Ctrl-C is sent to copy the results to the Windows clipboard. You could then use the cliptofile command to save the results to a text file for further analysis or use cliptostr to copy the results to a string. One thing to be aware of is that ASPECT is limited to 256-byte strings, so some data may be lost in the copy process.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top