What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Restart script through code

Restart script through code
Author: Message:
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
O.P. Restart script through code
I'm trying to restart a script trough code...

I was thinking, because Plus restarts the script when it detects changes, I would change the script, through my own script
So I open the script, write a nullstring, and close it again...
Theoraticaly it should work, it also works when I open in notepad
But I can't seem to open the file, because it is "in use" or something

Can anyone help me?

I have this code so far:
code:
function Restart () {
   try {
      var File = fso.OpenTextFile(MsgPlus.ScriptFilesPath + "\\Main.js", 8, 0, -1)
      File.WriteLine("")
      File.Close()
   } catch (e) {
      //Couldn't restart...
   }       
}
And somewhere else in the script, I just want to read the contents, but it gives the same error:
code:
var File = fso.OpenTextFile(MsgPlus.ScriptFilesPath + "\\Main.js", 1, 0, -1)
var Lines = File.ReadAll().split(/\r\n?|\n\r?/)
File.Close()

fso is a declared FileSystemObject

This post was edited on 09-23-2006 at 09:09 AM by Shondoit.
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
09-23-2006 08:43 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Restart script through code - by Shondoit on 09-23-2006 at 08:43 AM
RE: Reading scriptfile - by Matti on 09-23-2006 at 08:53 AM
RE: Reading scriptfile - by Shondoit on 09-23-2006 at 08:55 AM
RE: Reading scriptfile - by Eljay on 09-23-2006 at 08:57 AM
RE: Reading scriptfile - by phalanxii on 09-23-2006 at 09:02 AM
RE: Reading scriptfile - by Shondoit on 09-23-2006 at 09:02 AM
RE: Reading scriptfile - by Eljay on 09-23-2006 at 09:05 AM
RE: Reading scriptfile - by Shondoit on 09-23-2006 at 09:08 AM
RE: Restart script through code - by CookieRevised on 09-23-2006 at 05:24 PM
RE: Restart script through code - by Matti on 09-23-2006 at 05:33 PM
RE: Restart script through code - by saralk on 09-23-2006 at 06:23 PM
RE: Restart script through code - by Shondoit on 09-23-2006 at 07:11 PM


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