Documents Actions

Table of contents

  1. Convert to USDZ
  2. Archives
    1. Extract Archive
    2. Make Archive
  3. Books
    1. Add to Books
  4. Editing
    1. Markup
  5. Files & Folders
    1. Append File
    2. Create Folder
    3. Delete Files
    4. File Size
    5. Filter Files
    6. Get File
    7. Get File Detail
    8. Get File From Folder
    9. Get File Link
    10. Get Folder Contacts
    11. Get Parent Directory
    12. Get Selected
    13. Label File
    14. Open File
    15. Prepend File
    16. Rename File
    17. Reveal in Finder
    18. Save File
    19. Save File Prompt
    20. Select File
    21. Select Folder
  6. Notes
    1. Append Note
    2. Open Note
  7. Printing
    1. Print
  8. QR Codes
    1. Make QR Code

To use actions in this category, use this include statement:

#include 'actions/documents'

Convert to USDZ

convertToUSDZ(variable file)

Archives

Extract Archive

Extract files from the archive file.

extractArchive(variable file)

Make Archive

Create an archive of files named name in format.

enum archiveFormat {
    '.zip',
    '.tar.gz',
    '.tar.bz2',
    '.tar.xz',
    '.tar',
    '.gz',
    '.cpio',
    '.iso',
}

makeArchive(variable files, archiveFormat ?format = ".zip", text ?name)

Books

Add to Books

Add input to books. input is expected to be a PDF or epub file.

addToBooks(variable input)

Editing

Markup

Opens document in a markup editor.

markup(variable document)

Files & Folders

Append File

Append text to a file.

appendToFile(text filePath, text text)

Create Folder

Create a folder.

createFolder(text path)

Delete Files

Delete a file or multiple files.

deleteFiles(variable input, bool ?immediately = false)

File Size

Returns the size of a file.

enum fileSizeFormat {
    'Closest Unit',
    'Bytes',
    'Kilobytes',
    'Megabytes',
    'Gigabytes',
    'Terabytes',
    'Petabytes',
    'Exabytes',
    'Zettabytes',
    'Yottabytes',
}

fileSize(variable file, fileSizeFormat format)

Filter Files

Filter the provided files with various filters.

enum filesSortBy {
    'File Size',
    'File Extension',
    'Creation Date',
    'File Path',
    'Last Modified Date',
    'Name',
    'Random',
}

enum fileOrderings {
    'Smallest First',
    'Biggest First',
    'Latest First',
    'Oldest First',
    'A to Z',
    'Z to A',
}

filterFiles(variable files, number ?limit, filesSortBy ?sortBy, fileOrderings ?orderBy)

Get File

Get file from a path in the Shortcuts folder.

getFile(text path, bool ?errorIfNotFound = true)

Get File Detail

Get a detail about a file.

enum fileDetail {
    'File Size',
    'File Extension',
    'Creation Date',
    'File Path',
    'Last Modified Date',
    'Name',
}

getFileDetail(variable file, fileDetail detail)

Get File From Folder

Get a file from a folder.

getFileFromFolder(text folder, text path, bool ?errorIfNotFound = true)

Get a link for the provided file.

getFileLink(variable file)

Get Folder Contacts

Get contents of folder.

getFolderContents(variable folder, bool ?recursive = false)

Get Parent Directory

Get the parent directory of the input directory.

getParentDirectory(variable input)

Get Selected

getSelectedFiles()

Label File

Label a file.

enum fileLabel {
    'red',
    'orange',
    'yellow',
    'green',
    'blue',
    'purple',
    'gray',
}

labelFile(variable file, fileLabel color)

Open File

Open a file.

openFile(variable file, bool ?askWhenRun = false)

Prepend File

Prepend text to a file.

prependToFile(text filePath, text text)

Rename File

rename(variable file, text newName)

Reveal in Finder

reveal(variable files)

Save File

Save contents to a file at the specified path.

saveFile(text path, variable content, bool ?overwrite = false)

Save File Prompt

Prompt the user to choose a location to save the file.

saveFilePrompt(variable file, bool ?overwrite = false)

Select File

Prompt the user to select one or optionally multiple files.

selectFile(bool ?selectMultiple = false)

Select Folder

Prompt the user to select one or optionally multiple folders.

selectFolder(bool ?selectMultiple = false)

Notes

Append Note

Append text to a note.

appendNote(text note, text input)

Open Note

Open note in the Notes app.

openNote(variable note)

Printing

Print

Print input to a printer.

print(variable input)

QR Codes

Make QR Code

enum QRCodeErrorCorrection {
    'Low',
    'Medium',
    'Quartile',
    'High',
}

makeQRCode(text input, QRCodeErrorCorrection ?errorCorrection = "Medium")

Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.