Script opens "Pick Directory" twiceHi all,
I find this weird behaviour and can't tell why... If I take the script of Multiple File Import and replace the directory path with a "Pick Directory", It opens the pick directory dialog twice. It works still, but why does it open up twice?
tblref = Multiple File Import(
<<SET folder=""></SET>
<P>Appreciate any help :)</img></P>
<P>Thanks</P>
<P>Florian</P>Re: Script opens "Pick Directory" twiceAt a guess - it's already got a pick directory() call in there when there isn't a file path. But - the interesting thing is that when you leave out the pick directory() and just have the empty set folder() piece it throws an error for not enough arguments. Digging into the scripting index, there's another plan of attack you might try to get what you want:
// from the scripting index's "Set folder" example under the MFI section
Names Default To Here( 1 );
// Create the MFI object (you could put everything but your directory call here)
mfi = Multiple File Import();
// get the directory of interest
path = pick directory()
// set the path for the directory in the mfi object
mfi << Set Folder( path );
// run the thing
mfi << Import Data;
Re: Script opens "Pick Directory" twiceHi @Florian_Vogt ,the example in the scripting index (below), will open the multiple file import utility and there's a default option to select the directory. I don't think it's necessary to add the additional "Pick Directory" function.
Multiple File Import( <<SET folder=""></SET>
Re: Script opens "Pick Directory" twiceThank you all - great support as always
@DonMcCormack @MikeD_Anderson @nick_shelton
Will go with the solution of putting the "pick directory()" outside of the MFI script, which perfectly does the job!
Thanks and have a good weekend!