Re: need explanation for trivial Safari script behavior
Re: need explanation for trivial Safari script behavior
- Subject: Re: need explanation for trivial Safari script behavior
- From: Axel Luttgens <email@hidden>
- Date: Sun, 17 Jul 2016 12:17:51 +0200
> 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