Come ottenere questo elenco di script da inserire correttamente in un'espressioneCiao a tutti,
Sto cercando di scrivere uno script in grado di catturare le caselle di modifica del testo e il loro contenuto che si trovano in una casella di struttura (che l'utente potrebbe modificare; potrebbero esserci un numero qualsiasi di TEB, con qualsiasi testo e potrebbero essere ripetuti in un numero diverso di caselle di struttura).
La sfida che ho è riuscire a catturare correttamente lo script per i TEB che vengono visualizzati come elenco; voglio poter inserire quell'elenco come comando script per eseguirlo in una nuova finestra (essenzialmente salvando una copia di ciò che sono e contengono i TEB). Sono bloccato nel riuscire a farlo inserire/sostituire correttamente e apparire nella nuova finestra.
//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>
Re: Come ottenere questo elenco di script da inserire correttamente in un'espressioneCiao Ben,
Un modo (tra i tanti, ne sono sicuro) per fare quello che penso tu stia cercando di fare è quello di mettere un handle sulla vlistbox nello script Nuova finestra e aggiungere ogni casella di testo una volta che la finestra è presente.
Saluti,
Brady
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>
Re: Come ottenere questo elenco di script da inserire correttamente in un'espressioneIn alternativa, se si desidera creare la nuova espressione della finestra per utilizzarla in seguito, è possibile procedere come segue:
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;