Skip to content

Documents ​

Files, folders, archives, PDF, and rich text.

import Documents;

appendToTextFile ​

Adds the text passed as input to the end of the specified text file.

appendToTextFile(folder: File, filePath: Text, mode: Enum, makeNewLine: Boolean, text: Text) -> File
ParameterTypeDefault
folderFile—
filePathText—
modeAppend | Prepend"Append"
makeNewLineBooleantrue
textText—

If no file exists yet at the specified path, a new file will be created. Make sure to include a file extension (usually .txt) at the end of your path.

Shortcuts action: is.workflow.actions.file.append

compressPdf ​

Optimizes the file size of the provided PDF file by compressing its images.

If the images contained in the PDF are already compressed, this action might not have a measurable effect on file size.

compressPdf(pdf: File) -> File
ParameterTypeDefault
pdfFile—

Shortcuts action: is.workflow.actions.compresspdf

createFolder ​

Makes a new folder.

createFolder(path: Text, folder: File) -> File
ParameterTypeDefault
pathText—
folderFile—

Shortcuts action: is.workflow.actions.file.createfolder

deleteFiles ​

Deletes the files passed in as input.

deleteFiles(files: File, deleteImmediately: Boolean)
ParameterTypeDefault
filesFile—
deleteImmediatelyBooleanfalse

Shortcuts action: is.workflow.actions.file.delete

extractArchive ​

Extracts files from the archive passed as input. Many archive formats are supported, including zip, rar, tar.gz, tar.bz2, tar, gzip, cpio, cab, and iso archives.

extractArchive(archive: File) -> File
ParameterTypeDefault
archiveFile—

Shortcuts action: is.workflow.actions.unzip

findFiles ​

findFiles(sortBy: Enum, order: Enum, WFContentItemLimit: Boolean, WFContentItemLimitNumber: Number) -> File
ParameterTypeDefault
sortByName | File Extension | File Size | Creation Date | Last Modified Date | File Path—
orderLatest First | Oldest First—
WFContentItemLimitBooleanfalse
WFContentItemLimitNumberNumber5

Shortcuts action: is.workflow.actions.filter.files

getContentsOfFolder ​

This action gets the files inside of the specified folder.

getContentsOfFolder(folder: File, recursive: Boolean) -> File
ParameterTypeDefault
folderFile—
recursiveBooleanfalse

Shortcuts action: is.workflow.actions.file.getfoldercontents

getDetailsOfFiles ​

getDetailsOfFiles(get: Enum) -> Any
ParameterTypeDefault
getName | File Extension | File Size | Creation Date | Last Modified Date | File Path—

Shortcuts action: is.workflow.actions.properties.files

getFileFromFolder ​

Gets a file or folder by a relative path, starting at a folder you choose.

getFileFromFolder(errorIfNotFound: Boolean, ifFolder,FetchContents: Boolean, folder: File, path: Text) -> File
ParameterTypeDefault
errorIfNotFoundBooleantrue
ifFolder,FetchContentsBooleanfalse
folderFile—
pathText—

Shortcuts action: is.workflow.actions.documentpicker.open

getLinkToFile ​

Gets a public iCloud link to the file passed into the action. The specified file must already be uploaded to iCloud.

getLinkToFile(file: File) -> URL
ParameterTypeDefault
fileFile—

Shortcuts action: is.workflow.actions.file.getlink

getParentDirectory ​

Gets the common parent directory of the files passed in.

getParentDirectory(files: File) -> File
ParameterTypeDefault
filesFile—

Shortcuts action: is.workflow.actions.getparentdirectory

getSelectedFilesInFinder ​

Gets the files that are currently selected in Finder.

getSelectedFilesInFinder() -> File

Shortcuts action: is.workflow.actions.finder.getselectedfiles

getTextFromPdf ​

Gets text from the provided PDF file.

getTextFromPdf(pdf: File, type: Enum, pageHeaderText: Text, pageFooterText: Text, combinePages: Boolean) -> Text
ParameterTypeDefault
pdfFile—
typeText | Rich Text"Text"
pageHeaderTextText—
pageFooterTextText—
combinePagesBooleantrue

Shortcuts action: is.workflow.actions.gettextfrompdf

labelFiles ​

Applies a label to the specified files.

labelFiles(files: File, labelColor: Text)
ParameterTypeDefault
filesFile—
labelColorText—

Shortcuts action: is.workflow.actions.file.label

makeArchive ​

Makes an archive out of the files passed as input. Supports creating zip, tar.gz, tar.bz2, tar.xz, tar, gzip, cpio, or iso archives.

makeArchive(archiveName: Text, format: Text, input: Any) -> File
ParameterTypeDefault
archiveNameText—
formatText—
inputAny—

Shortcuts action: is.workflow.actions.makezip

makeDiskImage ​

Creates a new disk image (.dmg) file. The disk image will contain any files passed as input.

makeDiskImage(files: File, volumeName: Text, encrypt: Boolean, sizeToFitContents: Boolean, imageSize: Number) -> File
ParameterTypeDefault
filesFile—
volumeNameText—
encryptBoolean—
sizeToFitContentsBooleanfalse
imageSizeNumber1

Shortcuts action: is.workflow.actions.makediskimage

makeHtmlFromRichText ​

Converts the rich text passed as input to HTML text.

makeHtmlFromRichText(makeFullDocument: Boolean, richText: RichText) -> Text
ParameterTypeDefault
makeFullDocumentBoolean—
richTextRichText—

Shortcuts action: is.workflow.actions.gethtmlfromrichtext

makeImageFromPdfPage ​

Creates images from the pages in the PDF passed into the action.

makeImageFromPdfPage(pdf: File, imageFormat: Text, color: Text, resolution(dotsPerInch): Number) -> Image
ParameterTypeDefault
pdfFile—
imageFormatText—
colorText—
resolution(dotsPerInch)Number300

Shortcuts action: is.workflow.actions.makeimagefrompdfpage

makeImageFromRichText ​

Creates an image from the rich text, web content, or URL passed in as input.

makeImageFromRichText(richText: Any, width: Number, height: Number) -> Image
ParameterTypeDefault
richTextAny—
widthNumber1024
heightNumber768

Shortcuts action: is.workflow.actions.makeimagefromrichtext

makeMarkdownFromRichText ​

Converts the rich text passed as input to Markdown text (comparable to Aaron Swartz's html2text script).

makeMarkdownFromRichText(richText: RichText) -> Text
ParameterTypeDefault
richTextRichText—

Shortcuts action: is.workflow.actions.getmarkdownfromrichtext

makePdf ​

Makes a PDF out of the input. The resulting PDF can optionally include a quarter-inch margin for better printing.

makePdf(includeMargin: Boolean, include: Enum, page#: Number, startPage#: Number, endPage#: Number, input: Any, mergeBehavior: Enum) -> File
ParameterTypeDefault
includeMarginBooleanfalse
includeAll Pages | Single Page | Page Range"All Pages"
page#Number—
startPage#Number—
endPage#Number—
inputAny—
mergeBehaviorAppend | Shuffle"Append"

Shortcuts action: is.workflow.actions.makepdf

makeRichTextFromHtml ​

Takes the inputted HTML and turns it into rich text, which can then be converted to other formats.

makeRichTextFromHtml(html: RichText) -> RichText
ParameterTypeDefault
htmlRichText—

Shortcuts action: is.workflow.actions.getrichtextfromhtml

makeRichTextFromMarkdown ​

Takes the inputted Markdown and turns it into rich text, which can then be converted to other formats.

makeRichTextFromMarkdown(markdownText: Text) -> RichText
ParameterTypeDefault
markdownTextText—

Shortcuts action: is.workflow.actions.getrichtextfrommarkdown

mountDiskImage ​

Mounts a disk image (.dmg) file on your desktop.

mountDiskImage(file: File) -> File
ParameterTypeDefault
fileFile—

Shortcuts action: is.workflow.actions.mountdiskimage

moveFile ​

Moves the specified file to a new location.

moveFile(file: File, folder: File, replaceExistingFiles: Boolean) -> File
ParameterTypeDefault
fileFile—
folderFile—
replaceExistingFilesBooleanfalse

Shortcuts action: is.workflow.actions.file.move

print ​

Prints the input using AirPrint.

print(input: Any)
ParameterTypeDefault
inputAny—

Shortcuts action: is.workflow.actions.print

quickLook ​

Displays a preview of the input using the system Quick Look.

quickLook(input: File, fullScreen: Boolean)
ParameterTypeDefault
inputFile—
fullScreenBoolean—

Shortcuts action: is.workflow.actions.previewdocument

renameFile ​

Renames the specified file.

renameFile(file: File, name: Text) -> File
ParameterTypeDefault
fileFile—
nameText—

Shortcuts action: is.workflow.actions.file.rename

revealFilesInFinder ​

Opens windows in the Finder with the specified files selected.

revealFilesInFinder(files: File)
ParameterTypeDefault
filesFile—

Shortcuts action: is.workflow.actions.file.reveal

saveFile ​

Saves files to a specified folder. You can also use this action to copy a file.

saveFile(file: File, folder: File, askWhereToSave: Boolean, subpath: Text, overwriteIfFileExists: Boolean) -> File
ParameterTypeDefault
fileFile—
folderFile—
askWhereToSaveBooleantrue
subpathText—
overwriteIfFileExistsBooleanfalse

Shortcuts action: is.workflow.actions.documentpicker.save

selectFile ​

Prompts to select files or folders.

selectFile(type: Enum, selectMultiple: Boolean) -> File
ParameterTypeDefault
typeFiles | Folders"Files"
selectMultipleBooleanfalse

Shortcuts action: is.workflow.actions.file.select

specifyFile ​

Passes the specified files or folders as output.

specifyFile(file: File) -> File
ParameterTypeDefault
fileFile—

Shortcuts action: is.workflow.actions.file

splitPdfIntoPages ​

Splits the input document by creating a PDF for each page.

splitPdfIntoPages(pdf: File) -> File
ParameterTypeDefault
pdfFile—

Shortcuts action: is.workflow.actions.splitpdf