• 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
what's different about a list created from Array Controllers ArrangedObjects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

what's different about a list created from Array Controllers ArrangedObjects?


  • Subject: what's different about a list created from Array Controllers ArrangedObjects?
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 11 Jul 2015 23:02:56 +1000

G’day

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.

Is there something special about setting an Array Controllers ArrangedObjects() to a list that stops the items that are being looped through, from being matched to a search term that should be the same as at least one item? I’ve now got 7 repeats of the same item in the list.

My code, abbreviated, is below. I’ve tried ‘as text’ as well.

Scratching my head over this one???

Regards

Santa

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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Append AppleScriptObjC Script to Document-based Objc Project
  • Next by Date: Looking for help with modal window, please.
  • Previous by thread: Re: Append AppleScriptObjC Script to Document-based Objc Project
  • Next by thread: Looking for help with modal window, please.
  • Index(es):
    • Date
    • Thread