@Richardli asked unzip + multi file import
filename = Pick File( "Select zip File", "$DOCUMENTS", {"ZIP Files|zip", "All Files|*"}, 1, 0 );
// "/C:/Users/v1/Documents/saveappend.jmpaddin.zip"
If( filename != "" & File Exists( filename ), // check for canceled
za = Open( filename, "zip" );
listOfMembers = za << dir; // {"addin.def", "addin.jmpcust"};
// build the gui list of checkboxes
lb = Lineup Box( N Col( 3 ), spacing( 20 ) );
For( i = 1, i <= N Items( listOfMembers ), i += 1,
lb << append( Check Box( listOfMembers[i] ) )
);
New Window( "select members",
lb,
Button Box( "import selected",
dir = Convert File Path( "$temp/deleteMeCSV/" ); // "/C:/Users/v1/AppData/Local/Temp/deleteMeCSV/"
//delete directory(dir);// be CAREFUL !!! you might want to clean up before or after, but it does delete all the files!
Create Directory( dir );
Show( N Items( lb ) );
names = "";
For( i = 1, i <= N Items( lb ), i += 1,
If( lb[i] << get/* is checked */,
name = (lb[i] << get selected)[1]; // name of checked box is name of member
names = names || name || ";"; // explicit list of names, in case dir has old names
csvdata = za << read( name, Format( "blob" ) ); // load as blob, just in case
name = Save Text File( dir || name, csvdata ); // save for mfi
)
);
Multiple File Import( <<Set Folder( dir ), <<Set Name Filter( names ), <<Set Name Enable( 1 ), /* more parms here */ ) << Import Data;
)
);
);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.