What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] what is this! help to find default browser :O

[?] what is this! help to find default browser :O
Author: Message:
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. Sad  [?] what is this! help to find default browser :O
almost done the Youtube viewer.. but need help on this part.

i want to open a program ( IE ) which is opening a webpage on the script files path but it keeps showing an error that it cant find...

my Code:

code:
var Browser = "C:\Program Files\Internet Explorer\iexplore.exe";
function viewVideo(){
var Browser = TubeOption.RegRead(TubeBrowser); (dont mind that)
var Opener = new ActiveXObject("Shell.Application");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.CreateTextFile(MsgPlus.ScriptFilesPath + "\\Viewer.html", true);
var code = "<HTML>\n";
code += "<TITLE>YouTube Video: "+video+"</TITLE>\n";
code += "<BODY style='background:black'>\n";
code += "<Center><object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+video+"\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/"+video+"\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object></Center>\n";
code += "</BODY>\n";
code += "</HTML>";
file.WriteLine(code);
Opener.ShellExecute("\""+Browser+"\"  "+MsgPlus.ScriptFilesPath+"\\Viewer.html","","","open",1);
file.WriteLine(" ");
file.Close();
}

what did i do wrong?
[code]

This post was edited on 12-16-2006 at 07:07 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
12-16-2006 06:04 AM
Profile PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [?] what is this! omg anyone help; problem ehre
code:
var Browser = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
function viewVideo(video){
//var Browser = TubeOption.RegRead(TubeBrowser); (dont mind that)
var Opener = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.CreateTextFile(MsgPlus.ScriptFilesPath + "\\Viewer.html", true);
var code = "<HTML>\n";
code += "<TITLE>YouTube Video: "+video+"</TITLE>\n";
code += "<BODY style='background:black'>\n";
code += "<Center><object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+video+"\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/"+video+"\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object></Center>\n";
code += "</BODY>\n";
code += "</HTML>";
file.WriteLine(code);
Opener.Run("\""+Browser+"\"  \""+MsgPlus.ScriptFilesPath+"\\Viewer.html\"");
file.WriteLine(" ");
file.Close();
}
You can open the same in the default browser too
code:
function viewVideo(video){
var Shell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.CreateTextFile(MsgPlus.ScriptFilesPath + "\\Viewer.html", true);
var code = "<HTML>\n";
code += "<TITLE>YouTube Video: "+video+"</TITLE>\n";
code += "<BODY style='background:black'>\n";
code += "<Center><object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+video+"\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/"+video+"\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object></Center>\n";
code += "</BODY>\n";
code += "</HTML>";
file.WriteLine(code);
Shell.Run(MsgPlus.ScriptFilesPath+"\\Viewer.html");
file.WriteLine(" ");
file.Close();
}
12-16-2006 06:34 AM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [?] what is this! omg anyone help; problem ehre
To explain your mistake which Felu has corrected:

A backslash (ASCII code 92) in a string tells JScript that the following character is a special character. (like \n for a new line or \t for a tab space) When you want a literally backslash in your string, you have to escape it using a second backslash, like \\. If you don't, you get such errors. :)

And by the way, if you want it to open in IE and not in your default browser, you can just use:
code:
Opener.Run("iexplore.exe \""+MsgPlus.ScriptFilesPath+"\\Viewer.html\"");
instead of using the full path. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-16-2006 10:16 AM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: [?] what is this! omg anyone help; problem ehre
Bit off topic, but can you pleasebe a bit more descriptive in your thread titles so we know more about the error without having to read the thread
<Eljay> "Problems encountered: shit blew up" :zippy:
12-16-2006 11:06 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