• 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: need explanation for trivial Safari script behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need explanation for trivial Safari script behavior


  • Subject: Re: need explanation for trivial Safari script behavior
  • From: Mitchell L Model <email@hidden>
  • Date: Sun, 17 Jul 2016 19:31:24 -0400

I have the windows part working. The problem is when I want to similarly process the tabs of each window.

> On Jul 17, 2016, at 6:17 AM, Axel Luttgens <email@hidden> wrote:
>
>
>> Le 15 juil. 2016 à 22:56, Mitchell L Model a écrit :
>>
>> I am bewildered by the behavior of this most trivial Safari repeat.
>>
>> tell application "Safari"
>> 	repeat with theWindow in the windows
>> 		log the name of theWindow
>> 	end repeat
>> end tell
>>
>> What I get in the log is a long list of entries such as the following.
>>
>> 	(*name of item 7 of every window*)
>
> Hello Mitchell,
>
> By running this one
>
> 	tell application "Safari"
> 		repeat with theWindow in windows
> 			name of theWindow
> 		end repeat
> 	end tell
>
> it appears everything behaves as expected: upon each iteration, the name of the corresponding window is returned.
>
> Now, looking at the ASLG, more precisely at:
>
> 	https://developer.apple.com/library/prerelease/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW49
>
> one may read:
>
> 	[…]
> 	Parameters
> 	value
> 		The value to display. Expressions are evaluated but
> 		object specifiers are not resolved.
> 	[…]
>
> So, let’s feed the log command with an expression, for example:
>
> 	tell application "Safari"
> 		repeat with theWindow in windows
> 			log "" & name of theWindow
> 		end repeat
> 	end tell
>
> As a result, this is about the way the log command is implemented, not about some deficiency in Safari.
>
> HTH,
> Axel
>
>
>
>
>
> _______________________________________________
> 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


 _______________________________________________
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: 
 >need explanation for trivial Safari script behavior (From: Mitchell L Model <email@hidden>)
 >Re: need explanation for trivial Safari script behavior (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: need explanation for trivial Safari script behavior
  • Next by Date: Re: need explanation for trivial Safari script behavior
  • Previous by thread: Re: need explanation for trivial Safari script behavior
  • Next by thread: Re: need explanation for trivial Safari script behavior
  • Index(es):
    • Date
    • Thread