• 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: Setting Variables to List Items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting Variables to List Items


  • Subject: Re: Setting Variables to List Items
  • From: Emmanuel <email@hidden>
  • Date: Wed, 19 Mar 2003 08:51:39 +0100

At 2:09 PM -0600 18/03/03, Peter Bunn wrote:
Hello:

I'm trying to define (or associate?) a sequence of variables to a list of
individual items... (or at least that's what I _think_ I'm trying to do).

There must be a reason why you do that which is not a good reason.

Once you've got "all_items", then there is nothing you can do with "variable_1" etc. that you can't do with "all_items".

For instance, instead of "variable_3" you would say "item 3 of all_items".

Now your snippet lets me think that you want to use the contents of the variable *as a script*. My advice above remains true, you would say:

set example_string to "walk()-run()-hide()-quit"
set AppleScript's text item delimiters to "-"
set all_items to text items 2 through -1 of example_string as list

set theAction to item 1 of all_items

----------------------
tell application "Imaginary"
do script theAction
end
----------------------

Actually I think the script above won't work, I would rather try:

----------------------
set theScript to "tell application \"Imaginary\"
" & theAction & "
end"

do script theScript
----------------------

Emmanuel
_______________________________________________
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: Setting Variables to List Items
      • From: John Delacour <email@hidden>
    • Re: Setting Variables to List Items
      • From: Paul Berkowitz <email@hidden>
References: 
 >Setting Variables to List Items (From: Peter Bunn <email@hidden>)

  • Prev by Date: Re: how do I read values in a dropdown( ie pop up button) list out?
  • Next by Date: Re: Formatting text returned from shell script
  • Previous by thread: Re: Setting Variables to List Items
  • Next by thread: Re: Setting Variables to List Items
  • Index(es):
    • Date
    • Thread