Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Maplets[Utilities][GetFile] - flexible file selection dialog utility
Calling Sequence
GetFile(opts)
GetFile[refID](opts)
Parameters
opts
-
equation(s) of the form option=value; where option is one of approvecaption, approvecheck, directory, filefilter, filename, filterdescription, height, reference, resizable, title, or width; specify options for the Maplet application
refID
name or string; reference to the element
Description
The GetFile(opts) calling sequence displays a file dialog that allows the user to choose a file. The value returned is the string corresponding to the chosen file. If a file is not selected, NULL is returned.
This is a front-end to the FileDialog command. As such, leading and trailing spaces in filenames are automatically removed when a file is selected, and quoted filenames are also handled correctly.
Optionally, the GetFile utility validates the existence of a file.
Options
The opts argument can contain one or more of the following equations that set Maplet application options.
approvecaption = string or symbol
The text that appears on the button that is clicked to select the file. By default, the value is Open.
approvecheck = true or false
Indicates whether the existence of the file should be checked before exiting the Maplet application. By default, the value is true. If this is set to true, and the file is not present, an error dialog indicating this is displayed, and the Maplet application does not exit until a file is correctly chosen or the 'Cancel' button is pressed.
directory = string or symbol
Initial directory in which the file dialog opens.
filefilter = string or symbol
The extension of the files that display. By default, the value is "*", that is, all files are shown. It can also be used with other extensions, for example, "mws", "m", or "mpl".
filename = string or symbol
Initial filename when the file dialog opens. By default this is null.
filterdescription = string or symbol
A description of the filefilter. By default, this is all files.
height = posint
The height of the file dialog in pixels.
resizable = true or false
Whether the file dialog is resizable. By default this is true.
reference = name or string
A reference for the GetFile element.
If the reference is specified by both an index, for example, GetFile[refID], and in the calling sequence, an error results.
title = string or symbol
Specifies the Maplet application title. By default, the title is Get File.
width = posint
The width of the file dialog in pixels.
Examples
A file open dialog that checks for the existence of a file before exiting.
See Also
Maplets[Elements], Maplets[Elements][FileDialog], Maplets[Examples][GetFile], Maplets[Utilities], Overview of Maplet Applications
Download Help Document