<doc>
	<legacy_id>1083</legacy_id>
	<name>answer file</name>
	<type>command</type>

	<syntax>
		<example>answer file[s] <i>prompt</i> [with <i>defaultPath</i>] [titled <i>windowTitle</i>] [as sheet]</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Displays a standard file dialog for the user to select a file.</summary>

	<examples>
<example><p>answer file "Select a file to delete:"</p><p>if the result is not "Cancel" then</p><p>   put it into tChosenFile</p><p>   -- Use the file path as required</p><p>end if</p><p></p></example>
<example><p>answer files "Select the files you wish to process:"</p><p>if the result is not "Cancel" then</p><p>   put it into tChosenFiles</p><p>   repeat for each line tFile in tChosenFiles</p><p>      </p><p>   end repeat</p><p>end if</p></example>
<example><p>answer file "Input:" with "/Macintosh HD/"</p></example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="2.6">2.6</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<web/>
	</classes>

	<security>
		<disk/>
	</security>


	<classification>
		<category>Windows &amp; Dialog Boxes</category>
		<category>Files, Folders, &amp; Resources</category>
	</classification>

	<references>
		<function tag="files">files Function</function>
		<function tag="revMacFromUnixPath">revMacFromUnixPath Function</function>
		<function tag="revUnixFromMacPath">revUnixFromMacPath Function</function>
		<command tag="answer">answer Command</command>
		<command tag="answer file with type">answer file with type Command</command>
		<command tag="answer folder">answer folder Command</command>
		<command tag="ask file">ask file Command</command>
		<command tag="ask file with type">ask file with type Command</command>
		<command tag="revCopyFile">revCopyFile Command</command>
		<command tag="open file">open file Command</command>
		<property tag="systemFileSelector">systemFileSelector Property</property>
		<property tag="dontUseNS">dontUseNS Property</property>
		<keyword tag="it">it Keyword</keyword>
	</references>

	<description>
	<overview>Use the answer file command to open a file chooser dialog.</overview>

		<parameters>
<parameter>
<name>prompt</name>
<description>A string (or any expression that evaluates to a string). If you specify empty, no prompt appears.</description>
</parameter>

<parameter>
<name>defaultPath</name>
<description>The name and location of the folder whose contents are listed when the dialog box appears. If no defaultPath is specified, the dialog box lists the contents of the last folder you used with a file dialog box.</description>
</parameter>

<parameter>
<name>windowTitle</name>
<description>If specified, appears in the title bar of the dialog box. If no windowTitle is given, the title bar is blank. This parameter has no effect on Mac OS systems, because Mac OS file dialog boxes don't have a title bar.</description>
</parameter>		</parameters>

	<value>The <b>answer file</b> command places the absolute file path(s) of the selected file(s) as a return delimeted list in the it variable.<p></p><p>If the user cancels the dialog, the it variable is set to empty, and the result function returns "Cancel".</p></value>
	<comments>The dialog box displayed is the same one most programs use for the "Open" command in the File menu.<p></p><p><important> The answer file command does not open the file. It only displays the dialog box and retrieves the path to the file the user specifies.</p><p></important><p>If the as sheet form is used, the dialog box appears as a sheet on OS X systems. On other systems, the as sheet form has no effect and the dialog box appears normally. Attempting to open a sheet from within another sheet displays the second stack as a modal dialog box instead.  To give a dialog box a prompt when using the as sheet form a non-empty title must be provided.  This will cause the prompt to appear in the same place it would if as sheet was not being used.</p><p></p><p>If the <property tag="systemFileSelector">systemFileSelector property</property> is set to false, LiveCode's built-in dialog box is used instead of the operating system's standard file dialog.</p><p></p><p><note> If you wish to filter the list of the files presented to the user, use the <command tag="answer file with type">answer file with type command.</command></note></comments>
	</description>
</doc>