PDA

View Full Version : sourcing script


zin64
04-29-2007, 05:11 PM
Hi all,
I am trying to source script from external location.

string $projDir = `workspace -fullName` + "/mel/";

source ($projDir + "myScript.mel");

myScript;


However, I am having syntax error with the second line. Not sure where went wrong.
Hope someone could enlighten me.

Thanks in advance

Zin

GennadiyKorol
04-29-2007, 05:33 PM
Source is not a MEL command, it's a MEL interpreter directive. So you have to specify a hard coded, static path in quotes when using it.

As a workaround you could use something like

eval("source \"" + $projDir + ... + "\";");

Hope that helps:)

zin64
04-30-2007, 03:04 AM
Hi,
Thanks. It works beatifully. Now i could run the script from wherever i need.


Zin

CGTalk Moderation
04-30-2007, 03:04 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.