我想互相调用一个脚本:
<scriptdef name="script-to-call" language="javascript">
<attribute name="myattr" />
<![CDATA[
var myattr = attributes.get("myattr");
// ... do something
]]>
</scriptdef>
我试试这个,但我得到了
TypeError:找不到函数setMyattr
<scriptdef name="caller-script" language="javascript">
<![CDATA[
var task = project.createTask("script-to-call");
task.setMyattr("some value");
task.perform();
]]>
</scriptdef>
答案 0 :(得分:0)
这是解决方案:
var task = project.createTask("script-to-call");
task.setDynamicAttribute("myattr", "some value");
task.perform();