What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help running application on initialize

Pages: (2): « First « 1 [ 2 ] Last »
Help running application on initialize
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Help running application on initialize
Because of:
quote:
Originally posted by pedro_cesar
'cuz u missed a \ in the route right before "My Playlist"

And because you end your command line with a double slash (\\) which will be interpreted as a single slash (\).

In strings, if you wish to have a single slash, you must preceed it with an escape character. In JScript (and most other similar languages) the escape character is also a slash.

Hence why you must enter double slashes everywhere where you wish to use a single slash (\).

But the last character in your command line string is not meant to be a slash, it is meant to be a quote. Quotes are also special characters since they define strings. So either you tell JScript that the following character is going to be a special character and you must proceed it with the escape character (\), or either you enclose your entire string in single quotes (which also can be used in JScript to define a string):

Thus, either:
code:
Run("\"C:\\Documents and Settings\\James Ross\\My Documents\\My Music\\My Playlists\\Untitled Playlist.wpl\"");
or:
code:
Run('"C:\\Documents and Settings\\James Ross\\My Documents\\My Music\\My Playlists\\Untitled Playlist.wpl"');
where it begins with '" which is single quote ('), double quote (") and ends in "' which is double quote ("), single quote (').

What you put as command for the Run function must be enclosed into double quotes since it can/will contain spaces. These double quotes are part of the command line and string. They do not define the string. And since this entire command line (incl. double quotes) is a string you must enclose it into (double or single) quotes too.

This post was edited on 01-20-2007 at 01:49 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-20-2007 01:47 AM
Profile PM Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. RE: Help running application on initialize
This code still doesn't work and there is nothing in debug:
code:
function OnEvent_Signin(Email){
    new ActiveXObject('WScript.Shell').Run("\"C:\\Documents and Settings\\James Ross\\My Documents\\My Music\\My Playlists\\Untitled Playlist.wpl\"");
}
01-20-2007 08:34 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Help running application on initialize
That code should work perfectly... (it does here)...

Make sure WMP is properly installed and that the association with .wpl files is valid, and that path is correct and the playlist exists.

What happens if you go to Start > Run  and you enter:
   "C:\Documents and Settings\James Ross\My Documents\My Music\My Playlists\Untitled Playlist.wpl"
?
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-20-2007 01:28 PM
Profile PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
Status: Online
RE: Help running application on initialize
Try using ShellExecute.
YouTube closed-captions ripper (also allows you to download videos!)
01-20-2007 01:42 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Help running application on initialize
quote:
Originally posted by Mike
Try using ShellExecute.
which means using ShellExecute with the 'open' operation, which is the exact same thing as using Run.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-27-2007 04:05 PM
Profile PM Find Quote Report
balabek
New Member
*


Posts: 2
– / Male / –
Joined: Feb 2007
RE: Help running application on initialize
Thanks a lot for this.
I have added "Music Notification" for a few contacts :).
04-10-2007 12:53 PM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: Help running application on initialize
May I add something?

I'm quite sure you can run any program (which supports it) with the first parameter as the path to the file to be opened, and it will be opened when you run.

vikke
4 8 15 16 23 42
04-10-2007 01:09 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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