• 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: Confirming that a file is part of a Finder selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confirming that a file is part of a Finder selection


  • Subject: Re: Confirming that a file is part of a Finder selection
  • From: Thomas Fischer <email@hidden>
  • Date: Sun, 16 May 2010 12:32:28 +0200

Hello,

I find this interesting.

1. Just curious: Is there something like a command "get selected Finder items"?
I would (have to?) take
tell application "Finder" to set myList to get selection as text

2. I would try to use the contains/contained in operator:
if myTest is not in myList then
display dialog myTest & " is missing!"
else
# do your stuff
end if

3. It is not completely obvious to me how to define myTest for this purpose.
set myPrompt to "Where is the file 'info.xml?'"
tell application "Finder" to set myTest to (choose file with prompt myPrompt) as text
seems to do the job and would be easy if the file remains unchanged, but unpractical for arbitrary selections.

4. In that case, I would suggest something along the following lines:

set myTest to "info.xml" & return
tell application "Finder" to set myList to the selection as text
set the text item delimiters to return
if myTest is not in (myList as string) & return then
display dialog myTest & " is missing!"
else
# do your stuff
end if

All the best
Thomas

smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Confirming that a file is part of a Finder selection (From: "Jens" <email@hidden>)
 >Re: Confirming that a file is part of a Finder selection (From: Michelle Steiner <email@hidden>)
 >Re: Confirming that a file is part of a Finder selection (From: "Jens" <email@hidden>)
 >Re: Confirming that a file is part of a Finder selection (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Confirming that a file is part of a Finder selection
  • Next by Date: Identifying the frontmost application from a script saved as an application
  • Previous by thread: Re: Confirming that a file is part of a Finder selection
  • Next by thread: Identifying the frontmost application from a script saved as an application
  • Index(es):
    • Date
    • Thread