Full disclosure: I'm not a coder and JSL gives me a particularly difficult time, however I feel that this portion of the script I am writing should be far easier than it has been. I use the Data Filter frequently, with "Find" and "Regular Expressions" enabled (see image), however there is no option to save these settings so they must be cumbersomely re-enabled every time I open the filter. What I would like is an embedded table script that:
1) opens the data filter
2) automatically adds the currently selected column (i.e. I'll selected a column, then launch the script)
3) Enable "Find"
4) Enable "Regular Expression"
Unfortunately the save script option only saves this:
Current Data Table() << Data Filter(
Location( {630, 160} ),
Conditional,
Add Filter( columns( :name ), Display( :name, Size( 160, 225 ), List Display ) )
);
Find and Regex are not saved with the script . . .
But, here's the part that forced me to reach out for help, I cannot for the life of me figure out how to pass the currently-selected column's name to "columns()" and "Display()" functions.
I've tried many things, for example this:
Names Default to Here( 1 );
dt = Current Data Table( );
col_selected = dt << Get Selected Columns(string);
dt << Data Filter(
Location( {630, 160} ),
Conditional,
Add Filter( columns( col_selected ), Display( col_selected, Size( 160, 225 ), List Display ) )
);
But I get an error:
"Specified Column not found in data table. in access or evaluation of 'columns' , columns( col_selected ) /*###*/"
Probably becasue col_selected is a list, but I can't figure out how to get just the name out of the one-item list. Really shouldn't be this hard.