Re: Prompt to open file or folder
Re: Prompt to open file or folder
- Subject: Re: Prompt to open file or folder
- From: dev_sleidy <email@hidden>
- Date: Mon, 24 Jul 2006 22:01:15 -0400
'Is there syntax to allow a user to choose a file OR folder from the
one navigation window...' - with 'AppleScript' via 'Script Editor',
no.
'... 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?' -
with 'AppleScript' via 'Script Editor', yes; as demonstrated by 'J.
Stewart's previous post.
-----
Sample 'Smile' code, based on Emmanuel's 'navchoose' suggestion:
try
set tSelection to navchoose object with prompt "Select file(s) and /
or folder(s):" starting at (path to desktop folder from user domain)
with multiple files without show packages and open packages -- Allows
for multiple item selections.
--set tSelection to navchoose object with prompt "Select a file or
folder:" starting at (path to desktop folder from user domain)
without multiple files, show packages and open packages -- Allows for
only single item selection.
repeat with i in tSelection
set tKind to (kind of (info for i))
if (tKind is "folder") then
say "Folder"
else if (tKind contains "application") then
say "Application"
else
say "File"
end if
display dialog (name of (info for i)) buttons {"OK"} default button
"OK" giving up after 1
end repeat
on error
say "Precess canceled by user."
end try
_______________________________________________
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