         }
         plist[name] = items
         return plist
+    }
+    
+    required convenience init(coder: NSCoder) {
+        let name = coder.decodeObject(forKey: k.name) as! String
+        let list = coder.decodeObject(forKey: k.list) as! [PlayItem]
+        self.init(name: name, list: list)
+    }
+    
+    func encode(with coder: NSCoder) {
+        coder.encode(name, forKey: k.name)
+        coder.encode(list, forKey: k.list)
     }
 }
 

import Foundation
import QuickLook

class PlayList : NSObject {
    //  Keep playlist names unique
    var name : String = k.list {
        didSet {

    override init() {
        super.init()

        let temp = NSString(format:"%p",self) as String
        name = "play#" + String(temp.suffix(4))
        list = Array <PlayItem> ()

        if let appDelegate = NSApp.delegate {
            (appDelegate as! AppDelegate).playdicts[name] = list
        }
