Re: problem w/ text item delimiters
Re: problem w/ text item delimiters
- Subject: Re: problem w/ text item delimiters
- From: T&B <email@hidden>
- Date: Wed, 7 Feb 2007 11:41:50 +1100
What's very strange is that if you build your list using "as
string," as in the example below, it seems to work, even though the
class is already string.
Perhaps the problem is because you're not dereferencing the item
reference. When you use "repeat with myItem in myList" loop, any ruse
of myItem within that loop is actually the reference "item n in
myList", not the contents of the item itself. Simply preceding
reference with "contents of" will get the contents instead of the
reference. This often helps with seemingly strange results. It should
help in this case.
For example:
set myList to {"a", "b"}
repeat with myItem in myList
set myItemContents to contents of myItem
display dialog "Display myItem or contents of myItem?" buttons
{"Cancel", "myItem", "contents of"}
if button returned of result is "myItem" then
error myItem
else
error myItemContents
end if
end repeat
If you choose "myItem" in the dialog, you get "item 1" displayed in
the error dialog. If you choose "contents of", you see "a".
Tom
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden