• 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
This array controller code should be simple, do why doesn't it work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This array controller code should be simple, do why doesn't it work?


  • Subject: This array controller code should be simple, do why doesn't it work?
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 08 Sep 2014 12:09:03 +1000

G'day scripters

This code is copied and modified from a working handler, but it fails on the  line set theList to.

For the life of me I can't work out why. The variable stringToFind2 is an iTunes playlist persistent ID, and display as an alphanumeric string.

Why does the filteredArray part not like the stringToFind2?

I've checked and double checked all the bindings and Model Key Paths.

Any advice appreciated, please.

Regards

Santa

on addOnAChosenAdvertisement_()
try
tell advertisementsThatAreChosenTable to deselectAll_(me)
tell AdvertisementsToChoosefromArrayController
set allTheItems to selectedObjects()
end tell
repeat with theItems in allTheItems
set stringToFind1 to theItems's advertisementsName as text # advertisementsName, advertisementsTrackPath
set stringToFind2 to theItems's advertisementsTrackPath as text
display dialog stringToFind2 as text
tell AdvertisementsThatAreChosenArrayController
set aPredicate to current application's NSPredicate's predicateWithFormat_("advertisementsTrackPath == %@", stringToFind2)
say 1
set theList to advertisementsThatAreChosenData's filteredArrayUsingPredicate_(aPredicate)
if theList's |count|() = 0 then
say 3
my advertisementsThatAreChosenData's addObject_({advertisementsName:stringToFind1 as text, advertisementsTrackPath:stringToFind2 as text})
set my disableTheRemoveAdvertisementButton to false
end if
end tell
set my advertisementsThatAreChosenData to my advertisementsThatAreChosenData
end repeat
tell advertismentsToChooseFromTable to deselectAll_(me)
tell advertisementsThatAreChosenTable to deselectAll_(me)
my setTheAdvertisementsMoveArrows()
on error errmsg number errnum
display dialog "selectNewAdvertisement_ " & errmsg & return & errnum & return & return & "p = " & p
end try
my setTheAdvertisementsMoveArrows()
my interimSaveData()
end addOnAChosenAdvertisement_


 _______________________________________________
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

  • Follow-Ups:
    • Re: This array controller code should be simple, do why doesn't it work?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Need advice on icon problem please
  • Next by Date: Re: This array controller code should be simple, do why doesn't it work?
  • Previous by thread: Need advice on icon problem please
  • Next by thread: Re: This array controller code should be simple, do why doesn't it work?
  • Index(es):
    • Date
    • Thread