如何让这个脚本列表正确地插入到表达式中?大家好,
我正在尝试编写一个脚本,该脚本可以获取大纲框中包含的文本编辑框及其内容(用户可以编辑这些文本编辑框,可以有任意数量的文本编辑框,包含任意文本,并且可以在不同数量的大纲框下重复出现)。
我遇到的问题是,虽然我已经成功获取了以列表形式返回的 TEB 脚本,但我希望能够将该列表作为脚本命令插入,以便在新窗口中执行(本质上是保存 TEB 内容的副本)。我目前遇到的问题是如何正确地插入/替换脚本并将其显示在新窗口中。
//Example list that would track the name of OBs that could potentially change
OB_Titles={"Title 1", "Title 2"};
//Example window where there would be grabbable text boxes - these can vary in number
report_win=new window("Test", Text_OB=Outline Box(OB_Titles[1],
Text Edit Box("1"),
Text Edit Box("2"),
Text Edit Box("3"),
));
//Grabbing the reference of the boxes using the OB title list in order to get references to the TEBs
text_boxes = report_win <<
XPath("//OutlineBox[normalize-space(text())='" || OB_Titles[1] || "']//TextEditBox");
text_box_script=text_boxes<
<GET script=""></GET>
回复:如何将此脚本列表正确插入表达式中嗨,本,
实现你想要的功能的方法之一(当然还有很多其他方法)是在“新建窗口”脚本中给 vlistbox 添加一个句柄,并在窗口出现后追加每个文本框。
干杯,
布雷迪
Names Default to Here(1);
OB_Titles={"Title 1", "Title 2"};
//Example window where there would be grabbable text boxes - these can vary in number
report_win=new window("Test", Text_OB=Outline Box(OB_Titles[1],
Text Edit Box("1"),
Text Edit Box("2"),
Text Edit Box("3"),
));
//Grabbing the reference of the boxes using the OB title list in order to get references to the TEBs
text_boxes = report_win <<
XPath("//OutlineBox[normalize-space(text())='" || OB_Titles[1] || "']//TextEditBox");
text_box_script=text_boxes<
<GET script=""></GET>
回复:如何将此脚本列表正确插入表达式中或者,如果您希望构建新的窗口表达式以供稍后使用,您可以这样做:
nwExpr = Expr(
New Window( "Test",
Outline Box( "Parent OB", comm_OB = Outline Box( OB_Titles[1],
_VLB_SPEC ) )
)
);
// build up the vlistbox with its arguments
vlbExpr = Expr( V List Box() );
For Each( {s}, text_box_script, Insert Into( vlbExpr, Name Expr( s ) ) );
// once built, substitute into nwExpr
substitute Into (nwExpr, expr(_VLB_SPEC), nameexpr(vlbExpr));
// to show the window, evaluate nwExpr
nwExpr;