• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Prompt to open file or folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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

  • Prev by Date: Re: Hiding text input
  • Next by Date: Finder Text Document Preview
  • Previous by thread: Re: Prompt to open file or folder
  • Next by thread: Re: Prompt to open file or folder
  • Index(es):
    • Date
    • Thread