Re: Setting Variables to List Items
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.