• 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: are finder items items? what is a vector?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: are finder items items? what is a vector?


  • Subject: Re: are finder items items? what is a vector?
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 27 Dec 2009 15:47:50 -0800

> The error, as several others have said already, is that both sides of the "is in" operator (short for "is contained by", as mentioned) are supposed to be lists. This works:
>
> 1 is in {1,2,3}

 I'm not disagreeing with what Paul and others have said....
-------------------
tell application "Finder"
  set fitems to items of window 1
    repeat with i in fitems
     [i] --no error
      --[i] as vector --  errors, can't coerce value of i to vector
      --[i] is in selection -- errors, can't coerce value of i to vector
      --item 1 of window 1 is in selection -- errors, can't coerce to vector
      {i} is in selection -- doesn't error, but doesn't work, always false
      (i as alias) is in selection -- doesn't error, but doesn't work, always false

      (i as alias) is in (selection as alias list) --works
      (i as list) is in selection -- works
    end repeat
end tell
-----------

It's best to look for an alias in a list of aliases, or a string in a list of strings.


ES

 _______________________________________________
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: 
 >Re: are finder items items? what is a vector? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: are finder items items? what is a vector?
  • Next by Date: Re: are finder items items? what is a vector?
  • Previous by thread: Re: are finder items items? what is a vector?
  • Next by thread: Re: are finder items items? what is a vector?
  • Index(es):
    • Date
    • Thread