Create and write Array in plist

Hi,
I have a list “listingMenuDossier”
i want to save this list in my preference (list) with the name “listingDesDossiers”
But because it is a list, i doesn’t work.
I found that i need to create my key with the type “array”, but i don’t know how to do that ?

Here is the code i tried :

		tell NSUserDefaults
			tell its standardUserDefaults()
				its setObject_forKey_(listingMenuDossier, "listingDesDossiers")
			end tell
		end tell

Thanks for help !

You have to convert your listingMenuDossier to an NSArray to store it in a plist.

set listingMenuDossier to current application’s NSArray’s arrayWithArray_(listingMenuDossier)

Ric

The bridge should handle the conversion to an NSArray automatically – your code works fine here.

I wonder if the problem relates to what’s in the list; there are limitations on the type of item you can store in defaults.