oystercatcher Posted March 20, 2005 Posted March 20, 2005 AutoIt script to configure messenger after xp install. As this is my first script being posted if I have notfollowed certain forum conventions, let me know.; ---------------------------------------------------; Set Messenger Options Preferences to ; not run when win starts, not allow to run background ; ---------------------------------------------------;AutoItSetOption("WinTitleMatchMode", 4); ---------------------------------------------------$bslash="\"$DRV=@HomeDrive$PGD=@ProgramFilesDir$MSGDIR="\Messenger"$MEXE="msmsgs.exe"$messenger=$PGD&$MSGDIR&$bslash&$MEXE$title01="Windows Messenger"$wintext01="LogonWindow"$title05="Options"$wintext05="Personal"$wintext07="Preferences"; ---------------------------------------------------If NOT FileExists( $messenger ) Then MsgBox (0, $messenger, "Messenger program not found, Exiting") ExitElse Run( $messenger ) EndIf; ---------------------------------------------------Sleep(100)If WinWaitActive ( $title01, $wintext01 ) Then Send ("+{F10}") Send ("!TO")Else MsgBox (0, $title01, "waited for Messenger -- TIMEOUT")EndIf; ---------------------------------------------------Sleep(100)If WinWaitActive ( $title05, $wintext05 ) Then ControlClick( $title05, $wintext05, "SysTabControl321") Send ("{RIGHT 2}") Sleep(100); notice we change to wintext07 ControlCommand( $title05, $wintext07, "Button1", "UnCheck", "" ) ControlCommand( $title05, $wintext07, "Button2", "UnCheck", "" ) ControlClick( $title05, $wintext07, "Button10")Else MsgBox (0, $title05, "waited for Options -- TIMEOUT")EndIf; ---------------------------------------------------Sleep(100)If WinWaitActive ( $title01, $wintext01 ) Then Send ("+{F10}") Send ("!FC")Else MsgBox (0, $title01, "waited for Messenger final pass -- TIMEOUT")EndIf
Nanaki Posted March 20, 2005 Posted March 20, 2005 Use tags. This is a quick compile for the lazy people.
Nologic Posted March 21, 2005 Posted March 21, 2005 First off why is this not in the AutoIt thread...best if you stuff a copy in there for easy searching. Below is who I'd write the script based off what you have...you may or may not find this helpful.Dim $PID; On Error FunctionFunc _error($text) MsgBox (0, "Windows Messenger", $text, 3) ProcessClose ( $PID ) ExitEndFunc$messenger = @ProgramFilesDir & "\Messenger\msmsgs.exe"; If ExistsIf NOT FileExists( $messenger ) Then _error("Messenger program not found, Exiting")Else $PID = Run( $messenger )EndIf; Logon Window #1WinWaitActive ( "Windows Messenger", "LogonWindow", 2 )If NOT WinExists ( "Windows Messenger", "LogonWindow" ) Then _error("waited for Messenger -- TIMEOUT")EndIfSend ("+{F10}!TO"); PersonalWinWaitActive ( "Options", "Personal", 2)If NOT WinExists ( "Options", "Personal" ) Then _error("waited for Options -- TIMEOUT")EndIfControlClick( "Options", "", "SysTabControl321")Send ("{RIGHT 2}"); PreferencesWinWaitActive ( "Options", "Preferences", 2)If NOT WinExists ( "Options", "Preferences" ) Then _error("waited for Preferences -- TIMEOUT")EndIfControlCommand( "Options", "", "Button1", "UnCheck", "" )ControlCommand( "Options", "", "Button2", "UnCheck", "" )ControlClick ( "Options", "", "Button10"); Logon Window #2WinWaitActive ( "Windows Messenger", "LogonWindow", 2 )If NOT WinExists ( "Windows Messenger", "LogonWindow" ) Then _error("waited for Messenger final pass -- TIMEOUT")EndIfSend ("+{F10}!FC")Really the only thing I honestly have to suggest is that you make your code a little more readable...other wise your doing a great job, keep up the good work. Note:I may have the Send keys hosed.
oystercatcher Posted March 21, 2005 Author Posted March 21, 2005 Greetings Nologic,I looked around a bit but only saw the pinned autoit thread here under Application Installs. Not sure how to post to that thread. Also I must have fouled up the code tag or tags as my post got left justified and yours looks nice.Anyway, liked your post and will analyze it for future reference. Thanks
Nologic Posted March 21, 2005 Posted March 21, 2005 Well last I checked the autoit thread wasn't locked. Just list what the file is for and attach it in any file format (txt au3 zip rar) or if need be copy the code in...tho its best if the file is attached so the thread doesn't get to unmanageable over time. Any ways its good to have another scripter around. cya
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now