Action

Share as Text File

Posted by agiletortoise, Last update over 4 years ago

Send draft to system share sheet as a “.txt” text file, instead of plain text. This is useful, for example, to send as an attachment if you select the “Mail” action.

This action take advantage of advanced sharing options provided by the Share script object.

Steps

  • script

    // Share draft content as text file
    // Using first line as title
    
    let fileName = draft.processTemplate("[[safe_title]].txt");
    
    Share.shareAsFile(fileName, draft.content);

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.