Re: Prompt to open file or folder
Re: Prompt to open file or folder
- Subject: Re: Prompt to open file or folder
- From: "J. Stewart" <email@hidden>
- Date: Mon, 24 Jul 2006 07:13:10 -0400
On 7/24/06 at +1100 Brett Conlon said this
>Is there syntax to allow a user to choose a file OR folder from the one
>navigation window and then have the result tested for its class or do I
>have to have the user answer a question first like "Do you want to check a
>file or a folder?" with appropriate buttons?
Look at the 'choose file' and 'choose folder' commands in the StandardAdditions.osax as a place to start.
here's an example that's a bit simplistic.
--> Cut <--
display dialog "Pick \"File\" or \"Folder\"" buttons {"File", "Folder"}
if button returned of result is "File" then
set picked to (choose file with prompt "Choose a file")
else
set picked to (choose folder with prompt "Choose a folder")
end if
log (info for of picked)
--> Cut <--
Run this with event logging turned on in your script editor and take a look at the properties returned by this line of code -
log (info for of picked)
"info for" is also in the StandardAdditions.osax.
JBS
--
How do you tell when you're out of invisible ink?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden