• 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
Set Multiple variables to one value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Set Multiple variables to one value


  • Subject: Set Multiple variables to one value
  • From: "Stephen Swift (aka Burnum)" <email@hidden>
  • Date: Mon, 29 Jul 2002 21:02:13 -0400

Is it possible to set multiple variables to one value in one swoop?

Instead of:

set var1 to 30
set var2 to 30
set var3 to 30
set var4 to 30
set var5 to 30

Is there a way of simplifying it down into something like "set every item in
{var1, var2, var3, var4, var5} to 30"

This sort of works:

repeat with i in {var1, var2, var3, var4, var5}
set i to 30
end repeat

But requires the variables to be defined before running the repeat, which
sort of defeats the purpose of the loop in the first place. :-)

TIA

Stephen Swift ?' The Burnum Man
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Set Multiple variables to one value
      • From: Michelle Steiner <email@hidden>
    • Re: Set Multiple variables to one value
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Problems with system file of MacOS 9.1 or 9.2
  • Next by Date: Write to file??
  • Previous by thread: RE: Problems with system file of MacOS 9.1 or 9.2
  • Next by thread: Re: Set Multiple variables to one value
  • Index(es):
    • Date
    • Thread