I’m in a bit of a pickle.
I’m trying to amend an Array Controller list, but the item I’m searching for in items of the list isn’t being found.
I’ve checked the search in Vanilla Applescript using a list of the same items, and my search term is being found OK.
set tempEntry to (my theSender as text) & " ⦿" & (tempMailbox as text) & "⦿ •" & (my theSubject as text) & "•• Ω " & (my currentMailItemID as text) as text
tell emailListArrayController to set lastReceivedEmailsListTemp to arrangedObjects() as list
try
if (count of lastReceivedEmailsListTemp) > 0 then
set amendedList to {}
set y to (count of lastReceivedEmailsListTemp)
repeat with x from 1 to y
#
# This is not being matched, but exists in 5 places now, as it’s being added!
#
if (item x of lastReceivedEmailsListTemp) is not tempEntry then set end of amendedList to item x of lastReceivedEmailsListTemp
end repeat
set end of amendedList to tempEntry
tell emailListArrayController
removeObjects_(arrangedObjects())
repeat with eachObject in amendedList
addObject_(eachObject)
end repeat
addObject_(tempEntry)
end tell
# set tempEntry to eachObject
else
tell emailListArrayController to addObject:tempEntry
end if
try
# popUpButtonLastReceivedEmails's setTitle:(tempEntry as text)
end try
on error errmsg number errNum
if my runForOz then my displayError("OAs's oldEmailListSetter trap two " & errmsg & " number " & errNum as text)
return
end try