• 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: Batch update of properties of an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Batch update of properties of an object


  • Subject: Re: Batch update of properties of an object
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 01 Aug 2011 23:08:29 -0700
  • Thread-topic: Batch update of properties of an object

Try:

tell x
    set {its foo, its bar} to {y, z}
end tell

or in one line if you prefer:

tell x to set {its foo, its bar} to {y, z}

This should work even in cases where the application does not implement your
case 2), with the speed advantages of case 2).

--
Paul Berkowitz


> From: Leonid Bogdanov <email@hidden>
> Reply-To: Leonid Bogdanov <email@hidden>
> Date: Thu, 28 Jul 2011 09:19:11 +0400
> To: AppleScript-Users <email@hidden>
> Subject: Batch update of properties of an object
>
> Hello!
>
>   Is there a way to set values for several properties of an object at one
> time?
>   I came with two approaches, but not sure they're correct:
>
>   1) set properties of x to {foo: y, bar: z}
>   2) set {foo of x, bar of x} to {y, z}
>
>   And will I have any performance gain if I use one of these approaches,
> comparing to several set statements?
>
> Thank you!
>  _______________________________________________
> 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

  • Prev by Date: Re: set volume with / without output muted - fails in 10.7 (GM)
  • Next by Date: How to find the menu
  • Previous by thread: Re: set volume with / without output muted - fails in 10.7 (GM)
  • Next by thread: How to find the menu
  • Index(es):
    • Date
    • Thread