Load txt file from iCloud

If you want to load an HTML file and render it, you can do the following:

let fm = FileManager.iCloud()
let dir = fm.documentsDirectory()
let fileName = "html/fun/index.html"
let path = fm.joinPath(dir, fileName)
WebView.loadFile(path, new Size(0, 300))

Your HTML file should be located somewhere I side of Scriptables folder in iCloud Drive. In the above script it’s located at html/fun/index.html.