• 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
insert object update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

insert object update


  • Subject: insert object update
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 09 Aug 2011 12:50:25 +1000

G'day scripters

I've spent 1 1/2 days on this, and come to the conclusion that there's something wrong with insertObject_atArrangedObjectIndex_(anEntry2, storeEditRow )

The script below proves to me that the array I'm trying to insert is correct, but the insertion throws an error. The script 'hangs' on the insertion code being executed.

The error I get is  NSImageCell's object value must be an NSImage.  but I've checked, and all the appropriate parts of the array are images. (the display dialog returns 5 trues.)

If I use the ' addObject' statement, the exact same array gets added OK.

I'd like to check using  insertObjects_atArrangedObjectIndexes_(?,?) but can't work out how to set it up appropriately. Can anyone guide me please.

Regards

Santa

 


  on editChosenAlarm_(sender)
         theErrorTextField's setStringValue_("")
       say "editing"
        set enabled of cancelEditButton to true
        set enabled of deleteAlarm to false
        my sayTheSoundError_("You chosen an Alarm to Edit. Click 'Cancel Edit' if you don't want to Edit it.")
        tell theArrayController to set tempRow to  (santasAlarmClockTable's selectedRow()) as integer 
      if tempRow ≠ -1  then
        if editAlarmFlag = 2 then
            say "store Edit row "& storeEditRow
            set enabled of cancelEditButton to false
            set anEntry2  to  my setTheSavedString() 
            tell theArrayController to removeObjectAtArrangedObjectIndex_(storeEditRow)
            tell theWindow to displayIfNeeded()
            say "inserting"
            display dialog  (theActiveColumn of (text item 1 of anEntry2)= greenCircle)&(theSpeakColumn of (text item 1 of anEntry2)= greenCircle)&(theiTunesColumn of (text item 1 of anEntry2)= greenCircle)&(thePlayListRandomColumn of (text item 1 of anEntry2)= greenCircle)&(theDisplayFlagColumn of (text item 1 of anEntry2)= greenCircle) as text

            

            tell theArrayController to insertObject_atArrangedObjectIndex_(anEntry2, storeEditRow )
            tell theWindow to displayIfNeeded()
            say "should be inserted"
            --tell theArrayController to addObject_(anEntry2) 
            --my tableSelect_(storeEditRow)
               set editAlarmFlag to 0
               set theEditButton's title to "Edit Chosen Alarm" 
               set title of saveNewAlarm to "Save New Alarm"
               tell theWindow to displayIfNeeded()
               my saveData_(sender)
        else
            set storeEditRow to tempRow as integer
            my loadTheFieldsandButtons()
        end if
    end if
    end editChosenAlarm_





 _______________________________________________
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: insect data problem
  • Next by Date: Table checkboxes problems.
  • Previous by thread: Re: insect data problem
  • Next by thread: cocoa call for 'text item delimiters'
  • Index(es):
    • Date
    • Thread