Google Drive is an online file sync service.
You can also make your actions to create, append or prepend to any plain text files in your Google Drive using Google Drive actions steps.
Before running and Google Drive actions, you will be required to authenticate with Google to allow access to Google Drive. Visit Settings > Configure Accounts to link your Google account to Drafts.
Google Drive steps can be configured with these values:
- Parent: If blank, the action will target a file in the root of your Google Drive, you can also give the name of a folder at the root level, if the folder does not already exist, it will be created the first time you use the action. Currently Google Drive actions can only write to the root or folders directly in the root of your Google Drive, not in deeply nested folders. Tags can be used to dynamically name parents.
- Filename: The name for the file. Tags can be used to dynamically name files.
- Save as type:
- Text: Save as a plain text file. Plain text files can be appended/prepended, but cannot be editing in the Google Docs web interface.
- Doc: After upload, the file will be converted to Google Doc format and can be further edited in the Google Doc web interface. If the template outputs Markdown or raw HTML, it will be converted to rich text in the Doc format.
- Write: One of four possible output strategies:
- Create: Write to a new file each time the action is used. If a file with the same file name exists already, a second will be created with the same name (Google Drive allows duplicate file names).
- Append: Add to the end of a file.
- Prepend: Add to beginning of a file.
- Replace: Similar to “Create”, but instead of creating a new file if the file already exists, this will completely replace the contents of the existing file with the output of the action.
- Template: Defaults to the tag [[draft]], which will be the content of the current draft. Several tags are supported to add timestamps, but any other text – such as separator lines – can be added as well. Read more about supported template tags.
- Template output format:
- Text: Plain text
- Markdown: Output of the template will be assumed to be Markdown, and converted to HTML by the Markdown Engine.
- Raw HTML: Output of the template should be a complete raw HTML document, including <html><body> tags. This is an advanced setting which allows the inclusion of custom CSS and formatting.
- Prepend/Append actions may become somewhat inefficient if the target file becomes very large.
- If you want to find a starting place for your action, some importable samples are available at the Drafts Action Directory.