Re: what does this error mean?
Re: what does this error mean?
- Subject: Re: what does this error mean?
- From: "Stockly, Ed" <email@hidden>
- Date: Thu, 15 Jul 2010 17:05:12 -0500
- Acceptlanguage: en-US
- Thread-topic: what does this error mean?
Just to clarify....
I had another look at your posts, and realize that you actually have two
errors due to the difference between the way applescript handles lists and
records.
---- > set the end of alist to {bRecord:2}
Set the end of works with lists, but not with records.
At this point in your script alist is actually a record.
----> repeat with rec in recList
Repeat with anItem in aList
Works in lists, but does not work in records so the item rec is not defined
and that's what trips the error.
To illustrate, copy and paste the following into your script editor and open
the apple even log (or in SD, just step through the script)
------------
set alist to {}
log class of alist
set alist to {aRecord:1}
log class of alist
try
set the end of alist to {bRecord:2}
-- doesn't work because aList is a record
on error errMsg number errNum
display dialog errMsg
end try
set blist to {}
set blist to {1}
log class of blist
set the end of blist to {bRecord:2}
set the end of blist to {cRecord:3}
--works because blist is a list
set alist to alist & {bRecord:2}
log class of alist
repeat with thisRecordItem in alist
try
log thisRecordItem
on error errMsg number errNum
display dialog errMsg
end try
end repeat
------------
HTH
ES
On 7/14/10 8:05 PM, "tom wible" <email@hidden> wrote:
> on listTDL()
> if (count of recList) is 0 then ¬
> initRecList()
> set tdl to {}
> set n to 0
> repeat with rec in recList
> set n to n + 1
> if not rec's deleted then ¬
> set end of tdl to rec's toList(n)
> -- log item -1 of tdl
> end repeat
> return tdl
> end listTDL
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden