Jump to content

Using CommMG.au3 - this code always brings up Windows Media Player


Freedom1
 Share

Recommended Posts

Hello,

I'm using CommMG.au3, trying to automate a HyperTerminal session. Each time I run the application Windows Media Player starts up. I don't know exactly where it gets called from. Until this glitch turned up everything was going along OK. The code is just pieced together to test functionality.

In addition I have a couple of questions.

1. Can I run this with @sw_hide setting?

2. Better way to select from dropdown list as in sending the $BPS?

3. How to pause execution of script? I'm using msgbox(), but script continues.

#include <CommMg.au3>
; Test to Verify & Understand CommMg.au3
Local $AreaCode, $PhoneNbr, $Comport, $BPS, $Bits, $Parity, $StopBits, $CaptureFN, $HTFile
$AreaCode = "800"
$PhoneNbr = "555-1212"
$Comport = "COM1"
$BPS = "1"
$Bits = "8"
$Parity = "N"
$StopBits = "1"
$HTFile = "C:\HyperTerminal\TestHT.ht"
$CaptureFN = "c:\Freedom1.txt"
Opt("WinTitleMatchMode", 1)

; Start HyperTerminal
ShellExecute($HTFile, "", "", "", @SW_MAXIMIZE)
WinWaitActive("TestHT")

; Setup text capture parameters and command
Send("!TC", 0)
Send("!F", 0)
Send($CaptureFN, 0)
Send("{TAB}{TAB}{ENTER}", 0)

Send("!TCS", 0) ; End text capture
Send("!CD", 0) ; Disconnect call

; Setup modem settings
Send("!FR", 0) ; Go to Edit File Properties
Send("!E", 0) ; Area Code
Send($AreaCode, 0)
Send("!P", 0) ; Phone Number
Send($PhoneNbr, 0)
Send("!C", 0) ; Modem Port
Send($Comport, 0)
Send("!F", 0) ; Go to Configuration Page of Modem
Send("!B", 0) ; Bits per second
;Send($BPS, 0)      ; Wait until better way found for pulldown
Send("{HOME}11", 0) ; Select 19200 baud
Send("!D", 0) ; Data Bits
Send($Bits, 0)
Send("!P", 0) ; Parity
Send($Parity, 0)
Send("!S", 0) ; Stop Bits
Send($StopBits, 0)
Send("!F", 0) ; Flow Control
Send("HARDWARE", 0)
Send("{TAB}{TAB}{ENTER}", 0); Navigate to OK button
Send("{TAB}{ENTER}", 0) ; Navigate to OK button (1 level up)

MsgBox(0, "Pause to check Changes", "Check the results")

Send("!FX", 0) ; Close and exit HyperTerminal

Can anyone help out?

Thanks,

Freedom1

XP Pro SP3, AutoIt3

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...