Hi, I am trying to modify my code so that the user can selected which file path to save the result PNG files as well as naming the PNG files. The code is a subscript that will be called by the main script. My problem is that after I select the path and name the PNG file, I get a "Not a Name" error, the PNG file will be saved to the path I selected but the naming won't go through. How can I fix this?
Thanks!
MyGraph = Function({yCol},
{default local},
vars = Eval Expr(Variables(
X(:Test Stage),
Group X(:Lot)
));
pts = Expr(Box Plot(X));
For(j = 1, j <= Min(8, N Items(yCol)), j++,
Insert Into(vars, Eval Expr(Y(Expr(yCol[j]), Position(1))));
);
gb = Expr(
Graph Builder(
Size(1255, 981),
Show Control Panel(0),
Elements(Box Plot(X, Y(1), Y(2), Y(3), Y(4), Y(5), Y(6), Y(7), Y(8))),
Local Data Filter(
Add Filter(
columns(:Test Stage, :Sublot, :Temperature, :Soft Bin, :Serial Id),
Display(:Test Stage, N Items(4)),
Display(:Soft Bin, N Items(15))
)
)
)
);
Insert Into(gb, Name Expr(vars));
// Prompt the user to select a directory to save the PNG
dir_path = Pick Directory("Select Directory to Save PNG");
// Check if the user selected a directory
If(Is Empty(dir_path) == 0,
// Ask for the file name using New Window
nw = New Window("Save File", <<MODAL></MODAL>Have you verified that file_name contains what you think it does? You most likely want to either use << return results or get the value from text edit box using << get text when OK is pressed.