Skip to content

Instantly share code, notes, and snippets.

@simonbs
Last active April 18, 2020 10:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonbs/9a7f885d5b2f4941cc27134a8fe544a7 to your computer and use it in GitHub Desktop.
Save simonbs/9a7f885d5b2f4941cc27134a8fe544a7 to your computer and use it in GitHub Desktop.
Adds a tag to a file. To be used with Shortcuts.
let tag = args.shortcutParameter
let fm = FileManager.iCloud()
let filePath = args.fileURLs[0]
fm.addTag(filePath, tag)
let tags = fm.allTags(filePath)
let output = {"tags": tags}
Script.setShortcutOutput(output)
Script.complete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment