Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prompt to open file or folder



'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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Prompt to open file or folder (From: "J. Stewart" <email@hidden>)
 >Re: Prompt to open file or folder (From: Emmanuel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.