Hi
I Have a Problem with Paths..
In Version 6.5 of XSI I was using this line (JScript):
var DesktopPath = XSIUtils.ResolvePath("$USERPROFILE")+"\\Desktop";
I used this line to get Desktop path to export objects or
models..
But when I worked on ver.7 the command send me an error
on Value: "$USERPROFILE": Invalid argument specified.
He couldn't resolve that path..
So What's the problem?
Is there another way to get user profile path..?
Thanks 4 reading..
-
Desktop Path with ver.7
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Desktop Path with ver.7
An alternative way to get you the path you want would be:
I can't say, why "$USERPROFILE" doesn't work anymore.
I just tested it: under 7.01 and 7.5 it returned no error, but an empty string
and as you already stated, under 6.5 it still works....
Code: Select all
var DesktopPath = XSIUtils.Environment.Item("XSI_USERROOT") + "\\Desktop"
I just tested it: under 7.01 and 7.5 it returned no error, but an empty string
and as you already stated, under 6.5 it still works....
Stay safe, sane & healthy!
Re: Desktop Path with ver.7
Thanks it really works..
But how could I know more items of this environment please??
But how could I know more items of this environment please??
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Desktop Path with ver.7
Go to "Advanced Setup and Configuration > Environment Variables" in the User's Guide...
To find out how to get and set "environment variables" in scripting, type "Environment" in the index tab of the SDK documentation. ;)
To find out how to get and set "environment variables" in scripting, type "Environment" in the index tab of the SDK documentation. ;)
Stay safe, sane & healthy!
Re: Desktop Path with ver.7
Thanks really
Now I've understood a lot of things happend in Softimage..
now I Can define a variable and so many abilities are now available.. ;)
Thanks again
Now I've understood a lot of things happend in Softimage..
now I Can define a variable and so many abilities are now available.. ;)
Thanks again
Re: Desktop Path with ver.7
try this instead
var DesktopPath = XSIUtils.ResolvePath("$(USERPROFILE)")+"\\Desktop";
var DesktopPath = XSIUtils.ResolvePath("$(USERPROFILE)")+"\\Desktop";
Re: Desktop Path with ver.7
Well..
Just Perfect..!
It is the closest solution..
Thanks..
But I Have a simple question: How can I get more Paths like "$USERPATH"
is it from Environment variables??
Just Perfect..!
It is the closest solution..
Thanks..
But I Have a simple question: How can I get more Paths like "$USERPATH"
is it from Environment variables??
Who is online
Users browsing this forum: No registered users and 44 guests