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: Christopher Stone <email@hidden>
- Date: Fri, 15 Jul 2016 17:41:14 -0500
On Jul 15, 2016, at 15:56, Mitchell L Model <email@hidden> wrote:
I am bewildered by the behavior of this most trivial Safari repeat.
As Ed mentions log is not dereferencing theWindow.
-------------------------------------------------------------------------- tell application "Safari" repeat with theWindow in (windows where its document is not missing value) log (get name of theWindow) end repeat end tell --------------------------------------------------------------------------
theWindow is a pointer/reference unless/until it is dereferenced, and that can be very confusing until you get accustomed to it.
One use for this is changing list items in-place:
-------------------------------------------------------------------------- tell application "Safari" set winList to windows where its document is not missing value repeat with theWindow in winList set contents of theWindow to name of theWindow end repeat end tell
winList --------------------------------------------------------------------------
|
_______________________________________________
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