iCloud file manipulation shortcuts

You can solve your first problem using Scriptable and its File/Folder Bookmarks feature. Settings > File Bookmarks

Create a bookmark for the folder you are watching. You can then reference that folder in a script.

Here is a really basic example script named “Count Files”


let fm = FileManager.iCloud()
// reference folder bookmark created in Scriptable
let dir = fm.bookmarkedPath("Temp")
let contents = fm.listContents(dir)
let num_files = contents.length
Pasteboard.copyString(num_files.toString())
new CallbackURL("shortcuts://").open()

The following shortcut shows how to call the script and use the results.

I imagine there are more elegant solutions, but this may get you started

1 Like