Question: Maplets in a module

I am writing a module that will have several procedures. This module will be loaded using "with(modulename)."

Inside one of the procedures (a procedure dealing with opening a data file) I am testing for the existence of a file and, if it does not exist, it should open a filedialog so I can navigate to the relevant folder that has the file. Like this (test is set from the existence-checker to be true or false):

if (not test) then # have to get and set currentdir
  F1:=Maplets[Display](Maplet(FileDialog['F1']('fileselectionmode'='directoriesonly',title = "Select Folder",onapprove=Shutdown(['F1']))));

end if;

... etc.

Such a piece of code works fine when run interactively AND having been preceeded by "with(Maplets[Elements])."

How can I make it work in a procedure and/or module?? "with..." per the docs does not work in a module. The usual workaround Module:-procedure does not seem to work with Maplets. I tried using "with(Maplets[Elements])" in the calling worksheet, but no joy either.

I cannot believe that what I want cannot be done. But I need help.

Mac Dude

Please Wait...