It would. That’s the trouble. I’ve not found any scripts on iOS that truly run in the background.
For the sake of keeping everything together:
I’m pretty sure you can bypass the FilePicker
, but it’ll be messy and platform dependent. The file system differences will change where it lives.
For example, using Omni JS on my Mac, a FilePicker
url looks like this:
file:///Users/joebuhlig/Documents/omnifocus/templates/article.txt
That same file, but on iOS:
file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Documents/omnifocus/templates/article.txt
Regardless, you should be able to change line 20.
Original: var fileURL = urlsArray[0]
Replace with: URL.fromString("file:///Users/joebuhlig/Documents/omnifocus/templates/article.txt");