I am wondering how to request and accept input from an user in package. For example, I want to write a package that requires the user to specify the path to a given file or directory. In Summary I'd like to:
Thus far I've tried:
getFile::usage= "getFile imports the user specified file."
getFile[___]:=getFile=InputField["Enter the data directory"];
But this does not work as expected. When I call the package in a notebook and call the function getFile the dialog box gets created as an output cell instead of an input cell. What is a better and more robust method to request user input and assign that input to variables via a package?
Thanks for your help
Excellent! Up and running. Thank you!
This is because there is no Dialog in your code. This has nothing to do with the package. You call the function later, right?
So use Input, DialogInput or probably better suited for this job FileNameSetter.