A Guide to Sending Messages to Trilium via Apple Shortcuts
To use this guide, you will need:
This guide has been tested with iOS 15.5, but may also work with iOS 13. Feedback is appreciated.
This shortcut allows you to:
To learn more about the custom API, please see the documentation.
This feature is more powerful than what is displayed in the documentation, as it can directly import files from the project.
const htmlSanitizer = require("../services/html_sanitizer");
This method can be used to access unexposed features, but may also cause some unexpected behavior.
To create a custom request handler file, please use the handler. This is the most basic method, but you can also create your own logic, such as adding a clone.
JS backend
.#customRequestHandler={any_string}
. e.g. #customRequestHandler=takenote
.This creates an API that can be used to create notes. The request path to fill in the shortcut is {your web server path}/custom/{the any_string setted early}
.
Open links on your mobile device to get the shortcut.
Follow the instructions to install and configure the shortcut.
If prompted for permissions, grant them.
You can now enjoy sending messages to your Trilium server anytime, anywhere!
This shortcut provides very flexible usage methods.
When entering the body text, you can choose to directly input or use quoted input, and the source of the quote can be system input or clipboard content. When using quoted input, the command will use ---
as a separator. You can also modify the quoted input method in the shortcut.
You can add the shortcut to the main screen or to the assistive touch. To add it to the assistive touch, go to Settings-Accessibility-Assistive Touch
.
When using the system share function, you can find the shortcut and add it to your favorites. This way, you can pin it to the top in the edit menu for easier access.
Writing shortcuts can be inconvenient, as dragging and dropping can be buggy and accidentally deleting a node is easy.
If you need to make changes, it is recommended to use "copy" and "paste above/below".
Undo is available in the bottom left corner, so use it if things don't go as planned.
It is also recommended to copy the shortcut at key points to back it up.
If you experience lag during editing, try exiting and re-entering the app.
If a shortcut works when written, but does not function when executed, restarting your phone may be necessary.
As it can be difficult to modify shortcuts after writing them, it is recommended to implement pseudocode first and clarify the logic before writing the shortcut on your phone.
You can also refer to other people's shortcuts and use "copy" frequently if you have similar requirements.
This shortcut is only available for publishing or updating here and is not responsible for other sources.
If you have any questions or suggestions, please submit an issue.
If it is helpful to you, feel free to star it.