You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dragging images out of the editor into a folder doesn't copy it but rather removes it and there seems to be no way to export images as a result. Thanks in advance.
The text was updated successfully, but these errors were encountered:
import PlaygroundSupport
import Foundation
// put file.cape in the Resources folder of the macos playground
let fileURL = Bundle.main.url(forResource: "file", withExtension: "cape")!
let dec = PropertyListDecoder()
struct CapeFile: Codable {
let Author: String
let Cursors: [String: Cursor]
struct Cursor: Codable {
let Representations: [Data]
}
}
let cape = try dec.decode(CapeFile.self, from: Data(contentsOf: fileURL))
// this iterates through capes and writes the tiff files
// saved to ~/Desktop/dumped/
try cape.Cursors.forEach { (key: String, value: CapeFile.Cursor) in
let loc = URL.desktopDirectory.appendingPathComponent("dumped").appendingPathComponent(key).appendingPathExtension("tiff")
try FileManager.default.createDirectory(at: URL.desktopDirectory.appendingPathComponent("dumped"), withIntermediateDirectories: true)
try value.Representations.first?.write(to: loc)
}
Dragging images out of the editor into a folder doesn't copy it but rather removes it and there seems to be no way to export images as a result. Thanks in advance.
The text was updated successfully, but these errors were encountered: