• 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: Create variables from the script ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create variables from the script ?


  • Subject: Re: Create variables from the script ?
  • From: "Arthur J. Knapp" <email@hidden>
  • Date: Tue, 26 Nov 2002 16:54:42 -0500

> Date: Tue, 26 Nov 2002 21:54:31 +0100
> Subject: Create variables from the script ?
> From: Thomas <email@hidden>

> I was wondering if this would be possible to create variables from
> within the script. Here is a simple example :
>
> set list_folder to list folder "a folder"
> repeat with i from 1 to count of list_folder
> set vari to item i of list_folder
> end

> So i would get the name of the first folder in the variable var1, the
> name of the second folder in the variable var2... and the name of the
> nth folder in the variable varn.

> This is impossible right ?

More or less. There are many "hacks" available for doing something
similiar, but often when someone asks this question, it is simply
because they are unfamiliar or uncomfortable with using lists. May I
ask what you would ultimately like to do?


Here are some "mapping" solutions offered in the past by various authors:

ESG Labs's map:
<http://www.esglabs.com/snippets/map.sit.hqx>

My own AssociativeLib:
<http://www.applemods.com/getMod.php?script_ID=48>

Has's associativeArrayLib:

<http://www.barple.pwp.blueyonder.co.uk/libraries/associativeArrayLibFolder.
hqx>

This last is a speedy and highly optimized script object that works
well for even surprisingly large data-associations, (though I hate to
give the author an even larger ego than he already "has"). ;-)


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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: Create variables from the script ?
      • From: Thomas <email@hidden>
  • Prev by Date: Re: Set creator code of a package don't work
  • Next by Date: Re: Set creator code of a package don't work
  • Previous by thread: Re: Create variables from the script ?
  • Next by thread: Re: Create variables from the script ?
  • Index(es):
    • Date
    • Thread