如何讓這個腳本清單正確地插入到表達式中?大家好,
我正在嘗試編寫一個腳本,該腳本可以獲取大綱框中包含的文本編輯框及其內容(用戶可以編輯這些文本編輯框,可以有任意數量的文本編輯框,包含任意文本,並且可以在不同數量的大綱框下重複出現)。
我遇到的問題是,雖然我已經成功獲取了以列表形式返回的 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;