Hey all! I recently set up an SMB server on a local computer, and have connected it to my iPad so that I can easily save screen recordings and other large files externally.
I had things working last night, but after having to re-add my permissions in scriptable after disconnected from the server, my script to copy files and paste them on my server has broken! I get an error “could not copy files to ‘SMB’” (SMB being the bookmarkedPath name), but curiously there is an empty file created on the server after running.
I have added it to my file bookmarks and I can read/write from the files app manually without issue. Running it from a ‘run script’ shortcut in the files app, with the script set to always run in app.
Here is my code:
let file = args.fileURLs[0]
let bp = FileManager.local()
let fileName = file.split('/');
fileName = fileName[fileName.length-1];
let destination = bp.bookmarkedPath('SMB') + '/' + fileName
bp.copy(file, destination)