PDA

View Full Version : Problems with a path to a html document


Mikademius
09-19-2005, 12:32 PM
How come this works:

global proc SA_helpWindow()
{
string $helpWinName = "helpWindow";

if (`window -ex $helpWinName`)
{
deleteUI $helpWinName;
}

string $callUserScriptPath = `internalVar -usd`;

string $SA_helpWindow = `window -t "about shaderAssigner" -wh 764 450 -s 0 $helpWinName`;
string $helpMainColumn = `columnLayout helpMainColumn`;
string $helpBrowser = `webBrowser -width 750 -height 390
-url "C:\\Documents and Settings\\martina\\My Documents\\maya\\7.0\\scripts\\final3\\SA\\SA_documentation\\beta0.2_documentation.htm"`;

showWindow $SA_helpWindow;
}

SA_helpWindow;


while this doesn't?


global proc SA_helpWindow()
{
string $helpWinName = "helpWindow";

if (`window -ex $helpWinName`)
{
deleteUI $helpWinName;
}

string $callUserScriptPath = `internalVar -usd`;
string $wtf = ($callUserScriptPath + "final3/SA/SA_documentation/beta0.2_documentation.htm");

string $SA_helpWindow = `window -t "about shaderAssigner" -wh 764 450 -s 0 $helpWinName`;
string $helpMainColumn = `columnLayout helpMainColumn`;
string $helpBrowser = `webBrowser -width 750 -height 390
-url $wtf`;


showWindow $SA_helpWindow;
}

SA_helpWindow;


Can't I use the internalVar command here because the -url flag must have backslashes? I would like the script to point to the htm file, but I don't want the user to have to type in the path themselves.. Any ideas?
btw: the error is //Warning: c is not a registered protocol.

What does that mean?

brubin
09-19-2005, 01:03 PM
try replacing line
string $helpBrowser = `webBrowser -width 750 -height 390
-url $wtf`;
with

string $helpBrowser = `webBrowser -width 750 -height 390
-url ("\""+$wtf+"\"")`;
check the docs on "webbrowser"- command as well: the -url option is twice shown in examples as written between "".
HIH
s.

Mikademius
09-19-2005, 01:23 PM
Thanks, but it didn't work. And I can only see -openURL (-url) in the MEL command reference under webBrowser.... Any ideas? :sad:

brubin
09-19-2005, 02:09 PM
Examples

string $browser;

window;

columnLayout;

$browser = `webBrowser -width 800 -height 600 -url "www.alias.com"`;

showWindow;



webBrowser -edit -url "www.w3c.com" $browser;



webBrowser -edit -back $browser;

seee? :)
so, to cut a long story short: if you give a combined string as an option-parameter you don't have the leading and trailing "-char.s, hence my modified string in brackets.
works for me.

what's the error now?
because w/ the fix i gave you, you're error-message disappeared (for me), so if it still doesn't work it should be something else...

Mikademius
09-21-2005, 08:37 AM
Hey there brubin. Sorry for the late reply. Been kind of busy :)
I really don't understand what you mean regarding the examples here. They only show a creation and an edit.. Explain this to me like I'm a five year old....
The new error looks like this:

"www."c.com could not be found."

:banghead:

brubin
09-21-2005, 10:28 AM
you get the format mixed up since your string begins with"C:/..." as in "http://...", so i assume that's where the misinterpretation comes from.
so basically you need to do 2 things:

- make sure, your string (even the combined one) is passed literally to the webbrowser
command, meaning in enclosed "", hence the ("\""+$var+"\"")

- secondly: if you try to use a reference to a physical file on your server/machine instead
of a URL in WWW-space HTML provides a markup, so my guess is, your string should
work like this: ("\"file:///"+$var+"\"")

HIH
s.

Mikademius
10-24-2005, 09:29 AM
Maaan, sorry I haven't replied. I haven't had time to deal with the script in a while because of some crutial deadlines... I'll try your suggestions and tell you how it works :) Thanks man.

CGTalk Moderation
10-24-2005, 09:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.