Re: "where its" vs "whose"
Re: "where its" vs "whose"
- Subject: Re: "where its" vs "whose"
- From: Mitchell L Model <email@hidden>
- Date: Tue, 30 Aug 2016 10:37:16 -0400
I have written about many bewilderments in the past 6 months. Many of them had to do with working with Safari, but thinking that they were general AppleScript issues. I think we are learning from this discussion that there are certain areas in which Safari's support for AppleScript is defective, or at the least problematic if you are trying to use it.
I am learning from this and other recent experiences that when bewildered by some AppleScript behavior it is useful to try the same or similar script on a different application. I have found TextEdit to be the safest, but maybe I will run up against similar weirdness there. On Aug 29, 2016, at 10:07 PM, Shane Stanley < email@hidden> wrote:
On 30 Aug 2016, at 11:08 AM, Jim Underwood <email@hidden> wrote:
So, the guideline to myself is: - Use "whose" with properties
- Use "whose its" with elements
Can anyone verify or refute?
But you're using it with properties in all cases. Axel's point is the clue:
In the case of Safari, "document" is the name of a class, the name of an application’s elements and the name of a window’s property (all of these items having seemingly the same underlying code 'docu')
So when you use:
tell application "Safari" every window where document is not missing value end tell
The compiler isn't smart enough to work out which meaning of document you intend, and the test if performs is "document ≠ missing value", where "document" is the document class. Adding the "its" gives the compiler the necessary hint to test "every window's document ≠ missing value".
So the best answer is probably that "its" is required whenever there might be ambiguity.
|
_______________________________________________
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