What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Coding help

Coding help
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. Coding help
1) Why won't this work?
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if(Message=="notepad")
{
var shell = new ActiveXObject("wscript.shell");
shell.Run("notepad.exe");
return ""
}
}


2) How can i open notepad with some text already on it?
04-07-2007 04:23 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Coding help
1) The code seems to be fine. What does the debug window say?
2) Not possible unless you create a text file and edit it using a script and then open the next file.
04-07-2007 04:48 PM
Profile E-Mail PM Web Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / Male / Flag
Joined: Jul 2005
RE: Coding help
quote:
Originally posted by Jimbodude
1) Why won't this work?
works for me :^)

This post was edited on 04-07-2007 at 05:30 PM by Jesus.
Man is least himself when he is in his own person. Give him a mask and he will tell you the truth. (Oscar Wilde)
04-07-2007 05:29 PM
Profile PM Find Quote Report
felipEx
Scripting Contest Winner
***


Posts: 378
Reputation: 24
35 / Male / Flag
Joined: Jun 2006
RE: Coding help
you can try:
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if(Message=="notepad"){
return "/run notepad"
}
}

(A)
04-07-2007 09:30 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Coding help
if you are wanting it to act like a command then you forgot the / ;)

if you just write "notepad" (without the quotes) as your whole message then it will work as long as you don't have the likes of Message Customizer! Live installed which will add colour coding to your message.

quote:
2) How can i open notepad with some text already on it?
You have a coupe of choices:
  • make a new text file and open it
  • parse keys (not a good method)
  • use the copy and paste method which is in a different thread (again not good)

These are the only ways I know of.

This post was edited on 04-08-2007 at 09:08 AM by markee.
[Image: markee.png]
04-08-2007 09:04 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Coding help
1) provided you enter "notepad" (without the quotes) and you don't have any other script which messes up the text you entered, as markee has suggested, it is possible that notepad.exe isn't listed in your default path, hence the run command wouldn't be able to find it and be able to start it.


2) two ways:

a) create a textfile first and open this with notepad.
Either by simply specifying the temporary name of the textfile as the command line (this will open the textfile with your default associated program, which is probably notepad).
Or enter the temporary textfile as a parameter of notepad on the command line.

b) open up notepad, find the window, and use Windows APIs to fill the text in.

c) any method invovling parsing and/or sending keys (this includes copy/pasting) is not a proper method and should never be used.

This post was edited on 04-08-2007 at 09:13 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
04-08-2007 09:10 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On