Skip to content

Instantly share code, notes, and snippets.

@jhoughjr
Created July 23, 2018 02:01
Show Gist options
  • Save jhoughjr/594f55bc975606551d41d2944f53842a to your computer and use it in GitHub Desktop.
Save jhoughjr/594f55bc975606551d41d2944f53842a to your computer and use it in GitHub Desktop.
func docNoteRTFData(for docID:String,
inApp bundleID:String) -> String {
SwiftyBeaver.debug("docID is \(docID)")
if bundleID != "com.apple.finder" {
do {
let a = ghostnotesPath()
SwiftyBeaver.debug("Trying \(a)")
return try TextFile(path: a ).read()
}
catch {
SwiftyBeaver.error(error)
}
}else {
do {
let i = docID.index(of: ":")!
let newDocID = String(docID.suffix(from: i)).replacingOccurrences(of: ":",
with: "/")
let a = ghostnotesPath()
let b = (a + newDocID + " Note.rtfd/TXT.rtf").rawValue
SwiftyBeaver.debug("Trying \(b)")
return try TextFile(path: Path(b) ).read()
}
catch {
SwiftyBeaver.error(error)
}
}
@jhoughjr
Copy link
Author

21:00:28.900 DEBUG GhostNoteImporter.docNoteRTFData():155 - docID is Macbook Pro SSD:Users:jimmyhoughjr:workspace:application:Ghostnote 2.xcodeproj:
21:00:28.900 DEBUG GhostNoteImporter.docNoteRTFData():172 - Trying /Users/jimmyhoughjr/Library/Application Support/com.ghostnoteapp.Ghostnote/GhostNotes/AnySequence(_box: Swift._SequenceBox<Swift._DropFirstSequence<FileKit.DirectoryEnumerator>>)/ Note.rtfd/TXT.rtf
21:00:28.901 ERROR GhostNoteImporter.docNoteRTFData():176 - FileKitError(Could not read from file at "/Users/jimmyhoughjr/Library/Application Support/com.ghostnoteapp.Ghostnote/GhostNotes/AnySequence(_box: Swift._SequenceBox<Swift._DropFirstSequence<FileKit.DirectoryEnumerator>>)/ Note.rtfd/TXT.rtf")

Lets see if anyone else can see it. Bet no-one will look much less see it.

@jhoughjr
Copy link
Author

Fucking wow GitHub. Either fucking support the whole 16 bit address space of Unicode or get the fuck out. Wonder if BitBucket fully supports Unicode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment