Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
0 Kudos

Include use the parent default directory.

I would love it if I could force include() to use the default directory of the parent (or whatever I have set it to, instead of creating its own).  

For example

Names default to here(1);
dir = convert file path("$DESKTOP\TestDefaultDirectory\");
create directory(dir);
parent = JSLQuote(
	Set Default Directory(convert file path("$DESKTOP"));
	print("Parent");
	show(Get Default Directory());
	
	include("TestDefaultDirectory\child.jsl");
	
	print("Parent");
	show(Get Default Directory());
);

save text file(convert file path("Parent.jsl", base(dir)), parent);

child = JSLQuote(
	print("Child");
	show(Get Default Directory());
);
save text file(convert file path("Child.jsl", base(dir)), child);
nw = open(convert file path("Parent.jsl", base(dir)));
script = nw[scriptbox(1)];
script << Run();

Returns

"Parent"
Get Default Directory() = "/Desktop/";
"Child"
Get Default Directory() = "/Desktop/TestDefaultDirectory/";
"Parent"
Get Default Directory() = "/Desktop/";

I want the child to also return "/Desktop/"

 

Tracking Number:

Defect ID: