• 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: Can not get "item" from "position"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can not get "item" from "position"


  • Subject: Re: Can not get "item" from "position"
  • From: Andrei Tchijov <email@hidden>
  • Date: Wed, 4 Apr 2007 12:03:44 -0400

Thanks for reply. It does work with ( ... as list ). It works with ( get ... ) as well (thanks Emmanuel).
It looks like O'Reilly is lying in its AS book. They claim (page 239 -- Secondary List Classes ) that Point is in fact a list -- which is obviously not true. Same goes for "boundary" -- it looks like it is NOT list of 4 values.


Thanks again.

Andrei

On Apr 4, 2007, at 11:56 AM, Michelle Steiner wrote:

On Apr 4, 2007, at 8:40 AM, Andrei Tchijov wrote:

tell application "Finder"
	set targetWindow to the front window
	position of targetWindow
end tell

It's a tricky thing; you're getting a result that looks like one thing, but is actually another.


tell application "Finder"
	set targetWindow to the front window
	class of position of targetWindow
end tell
--> property

In other words, position is a property, not a list. So you need to cast the property into a list:

tell application "Finder"
	set targetWindow to the front window
	item 1 of (position of targetWindow as list)
end tell

The parentheses are important; it won't work without them.

-- Michelle

--
"So why did you do it?

"Cause I was told not to"

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


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: Can not get "item" from "position"
      • From: Emmanuel <email@hidden>
    • Re: Can not get "item" from "position"
      • From: Michelle Steiner <email@hidden>
References: 
 >Can not get "item" from "position" (From: Andrei Tchijov <email@hidden>)
 >Re: Can not get "item" from "position" (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Can not get "item" from "position"
  • Next by Date: Re: Can not get "item" from "position"
  • Previous by thread: Re: Can not get "item" from "position"
  • Next by thread: Re: Can not get "item" from "position"
  • Index(es):
    • Date
    • Thread