我有两个脚本,main.jsl 和 dosomething.jsl,它们在同一文件夹中彼此相邻。
主脚本中有这样的内容:
relativePath = "./";<BR />absolutePath = "c:\Users\myUser\Scripts\";<BR />dosomething = Expr(
Include( relativePath || "dosomething.jsl" )
);
这做一点事在整个脚本中执行某些操作,在运行主脚本的同时编辑 dosomething.jsl 非常方便。
所以,当我这样做时使用相对路径如上所述 - JMP 粉碎。 但使用时效果很好绝对路径。
现在,我不想使用绝对路径。 如何在 Include 语句中使用相对路径?
例如,这对于位于这两个脚本旁边的 Logo.png 来说效果很好:
Picture Box( Open( "./Logo.png", png ) )
如果相对路径不适用于 Include,是否有任何方法可以访问当前运行脚本的绝对路径?
再次,提出并写下问题让我知道在哪里寻找答案。
所以这有效:
relativePath = Get Default Directory();
absolutePath = "c:\Users\myUser\Scripts\";<BR /><BR />dosomething = Expr(
Include( relativePath || "dosomething.jsl" )
);