quote:
Originally posted by krissy-afc
quote:
Originally posted by glenncarr
quote:
Originally posted by Spunky
Not sure it's possible, but why would you want to do that?
Because I want to ... I use the command prompt and specifically SlickRun for a lot of may day-to-day development work. I'm just a command-line kinda guy.
Or just a wanna be show of hacker to-your-friends.
Uhmm, no.
Here's a script I threw together which sort of works, but only if the main Messenger client isn't already active. The AppActivate doesn't bring it to the foreground if the window already exists.
code:
args = WScript.Arguments
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run( 'msnmsgr.exe' )
WScript.Sleep( 200 )
WshShell.AppActivate( 'Windows Live Messenger' )
WScript.Sleep( 200 )
WshShell.SendKeys( "%AS")
WScript.Sleep( 200 )
WshShell.SendKeys( "%D")
if ( args.length >= 1 )
{
WshShell.SendKeys( args( 0 ) ) // Contact name
WScript.Sleep( 200 )
WshShell.SendKeys( "{ENTER}")
if ( args.length >= 2 )
{
WshShell.SendKeys( args( 1 ) ) // Message
WScript.Sleep( 200 )
WshShell.SendKeys( "{ENTER}")
}
}
Anyway, I'll dig around a while. Thanks, (and I glad I could impress you by wanting to use the command-line. old geezer command-line guys like me are cool
)
EDIT: Using
AutoIt works consistently (if anyone cares)...
code:
; im.au3
Run( "C:\Program Files (x86)\Windows Live\Messenger\msnmsgr.exe" )
WinWaitActive( "Windows Live Messenger" )
Send( "!AS" )
WinWaitActive( "Send an Instant Message" )
Send( "!D" )
If $CmdLine[ 0 ] >= 1 Then
Send( $CmdLine[ 1 ] )
Sleep( 200 )
Send( "{ENTER}" )
If $CmdLine[0] >= 2 Then
$msg = StringRight( $CmdLineRaw, StringLen( $CmdLineRaw ) - StringLen( @ScriptFullPath ) - 2 ) ; 2 for quotes
$msg = StringRight( $msg, StringLen( $msg ) - StringLen( $CmdLine[ 1 ] ) - 3 )
Send( $msg )
EndIf
EndIf
Usage: im.au3 <contact name> [message]
Cheers.