Skip to main content

File Content

Inserts the content of the selected file.

iOS Compatibility

⚠️ This feature is supported only on macOS.

iOS does not allow apps to access the file system.

Parameters

1️⃣ File Path

The path to the file that will be inserted. You will be prompted to select the file from the file picker.

Syntax

{@file-content|file:///Users/Snippety/Desktop/test.json@}

Notes

Sandboxed apps require a special permission to access a file. This permission is automatically requested when you select a file from the file picker.

Please note that if you share the snippet with someone else or use it on another device, you may need to recreate the placeholder to request the permission again.

Do not create this placeholder manually, selecting the file from the file picker is required to request the permission.

Use Cases

This placeholder may be useful when you want to share the same content between multiple snippets.

It can also be useful if you have a file that is updated frequently by external tools and you want to insert its content into the snippet and be sure that it is always up to date.

Example 1

You have a file that contains temperature readings from multiple sensors and you want to include it in a message that you send every day to your team. You could create the following snippet:

Good Morning Team,

Here are the current temperatures:
{@file-content|file:///some/path/temperature.txt@}

Example 2

You have a shared file in a cloud storage that contains the most recent instructions for new employees. You could create the following snippet:

Please follow these steps to set up your account:

{@file-content|file:///some/path/instructions.txt@}

Using this snippet, you can be sure that all employees receive the most recent instructions, even if the file is updated in the cloud by someone else.