Hello @Neo,
This should get you started. No Multiple File Import window will pop-up, it's built into the functionality of the new window. It's not pretty, but it works. Notice the items that happen only after the user presses the "OK" button. Hope this helps!
Names default to here(1);
// Creates window and asks user to a name to user for filtering
name_filter_win = New window( "Name filter",
vbox = v splitter box( // Contains 3 elements
// Element 1: Title
text box( "Enter file name filter" ),
// Element 2: Text input box
name_filter = Text edit box( "" ),
// Element 3: Button & script that runs after it's pressed
Button Box( "OK",
mfi_name_filter = name_filter << Get text(); // Gets text from text box
pick_dir = Pick directory( "Select a folder" ); // User chooses destination folder
Eval( // Multiple file import code
eval expr(
Multiple File Import(
<<Set Folder( expr( pick_dir ) ),
<<Set Show Hidden( 0 ), // 0 = does not include hidden stuff, 1 = include hidden stuff
<<Set Subfolders( 0 ), // 0 = not recursive, 1 = recursive
<<Set Name Filter( expr( mfi_name_filter ) ),
<<Set Name Enable( 1 ),
<<Set Add File Name Column( 0 ),
<<Set Add File Size Column( 0 ),
<<Set Add File Date Column( 0 ),
<<Set Import Mode( "CSVData" ),
<<Set Charset( "Best Guess" ),
<<Set Stack Mode( "Stack Similar" ),
<<Set CSV Has Headers( 1 ),
<<Set CSV Allow Numeric( 1 ),
<<Set CSV First Header Line( 1 ),
<<Set CSV Number Of Header Lines( 1 ),
<<Set CSV First Data Line( 2 ),
<<Set CSV EOF Comma( 1 ),
<<Set CSV EOF Tab( 0 ),
<<Set CSV EOF Space( 0 ),
<<Set CSV EOF Spaces( 0 ),
<<Set CSV EOF Other( "" ),
<<Set CSV EOL CRLF( 1 ),
<<Set CSV EOL CR( 1 ),
<<Set CSV EOL LF( 1 ),
<<Set CSV EOL Semicolon( 0 ),
<<Set CSV EOL Other( "" ),
<<Set CSV Quote( "\!"" ),
<<Set CSV Escape( "" ),
<<Set XML Method( "guess" ),
<<Set XML Guess( "huge" ),
<<Set XML Settings( XML Settings() ),
<<Set JSON Method( "guess" ),
<<Set JSON Guess( "huge" ),
<<Set JSON Settings( JSON Settings() ),
<<Set PDF Method( "guess" ),
<<Set PDF Settings( PDF All Tables( Combine( All ) ) ),
<<Set Import Callback( Empty() )
) << Import Data
)
);
name_filter_win << Close window; ) // closes window
)
);
Learning every day!