cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
SteveTerry
Level III

Multiple File Import fails quietly when reading file from folder protected by Privacy settings

Starting with Catalina, Mac OS provides support for Privacy controls on certain folders.  If, for example, a script tries to read a file on the Desktop with Multiple File Import, you'll get a popup saying that JMP Pro 16.app would like to access files in your Desktop folder.  If you select OK, everything works fine.  But if you select Don't Allow, the MFI instruction will fail without a runtime error, but might fail later (since a data table was not returned).  Some example code is:

 

fileList = Pick File( "Choose Insight File(s)", "~/Downloads", {"csvOnly|csv"}, 1, 0, "", "multiple" );
:
Multiple File Import( ... );
dt = Current Data Table();
allCols = dt << Get Column Names( String );

In this case, there is no Current Data Table, so dt is not defined, and the Get Column Names instruction fails with the following message:

 

Send Expects Scriptable Object in access or evaluation of 'Send' , dt <<  /*###*/Get Column Names( String ) /*###*/

The question is:  What is the recommended way to determine that the Multiple File Import command failed to open and read a file?

 

After one selects Don't Allow to the popup, the question won't be asked in the future, and MFI will just quietly fail.  (Note that the setting can be changed at any time in System Preferences, Security and Privacy, Privacy, Files and Folders, JMP Pro 16.app.)

 

More broadly, why did the Pick File command allow the Navigation window to access files on the Desktop in the first place?  It seems that private folders should be excluded in the Navigation window.

 

I also see that this is not an issue in JMP 15.  So respecting folder privacy is apparently something that was added in JMP 16.  (I'm running 16.2.0.)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Multiple File Import fails quietly when reading file from folder protected by Privacy settings

After investigating this issue further, I have reported this issue to Development. It seems macOS is not presenting the necessary prompt (JMP Pro 16.app would like to access files in your <> folder) for each directory. It only seems to do so for the Downloads directory. Other directories are ignored completely. Our Development team will continue to explore this issue. 

 

Regarding determining when MFI import may be failing when folder access is not granted, you may want to consider using the following: 

 

mfi = Multiple File Import(

<<Set Folder( "$DESKTOP" ),

<<Set Name Filter( "*.csv;" ),

<<Set Name Enable( 1 )

) << Import Data;

Show( mfi );
 
If( N Items( mfi ) == 0,

Caption( "No Files Imported" );

Stop();

);

View solution in original post

3 REPLIES 3
Phil_Kay
Staff

Re: Multiple File Import fails quietly when reading file from folder protected by Privacy settings

Hi,

I think that you might want to contact technical support (support@jmp.com) with this query.

Regards,

Phil

Re: Multiple File Import fails quietly when reading file from folder protected by Privacy settings

After investigating this issue further, I have reported this issue to Development. It seems macOS is not presenting the necessary prompt (JMP Pro 16.app would like to access files in your <> folder) for each directory. It only seems to do so for the Downloads directory. Other directories are ignored completely. Our Development team will continue to explore this issue. 

 

Regarding determining when MFI import may be failing when folder access is not granted, you may want to consider using the following: 

 

mfi = Multiple File Import(

<<Set Folder( "$DESKTOP" ),

<<Set Name Filter( "*.csv;" ),

<<Set Name Enable( 1 )

) << Import Data;

Show( mfi );
 
If( N Items( mfi ) == 0,

Caption( "No Files Imported" );

Stop();

);
SteveTerry
Level III

Re: Multiple File Import fails quietly when reading file from folder protected by Privacy settings

Thanks so much, Dahlia, for your patience and determination in helping to characterize this.  I look forward to a future JMP update.

 

I implemented the logic you provided, and my script now works very well and predictably.