Clipboard formatting, PDF generation, file saving — help?

Three questions:

• I use markdown to format my meeting notes before exporting to PDF to upload to the company’s backend. I want to copy the title of the Draft to the clipboard and use it to set the title of the PDF. Is there an easy way to Drafts to copy [[title]] to clipboard but strip out the # in the beginning?

• Is it possible to setup an Action that grabs everything from any line in a Draft that starts with a specific word, e.g. Homework, and generate a new draft with whatever it’s found?

• Is it possible to create an Action that generates a PDF, saves the PDF in a specific iCloud Drive folder, and then deletes the Draft? Not necessarily looking to have someone do it for me, just want to know if this is possible.

Thanks!

For your file name, from the Docs:

  • [[safe_title]] File name safe version of the first line with ASCII control characters and path separators that can interfere with file names removed (/:*?<>|#).

Actions are extremely versatile, and would be able to do what you describe in terms of copying/splitting. There are lots of examples with actions that work with various task management apps you could base it on.

In terms of PDF, you can pass Markdown content to Shortcuts that can generate PDF. That can even be triggered by an action which can trash your draft, or you could have your PDF shortcut “File” the draft. Specific folder saving is more complex due to sandboxing. If you manually choose where to save, then it can go anywhere. If you want to automatically save, apps can only save to their own iCloud folders; though utilising Scriptable, you might be able to work around that via bookmarking.

Hope that helps.

Oh, this is super helpful! Thanks so much! That change to the title is perfect, and it’s very helpful to know that what I want to do is possible, with the Action to collect specific lines and collect them in a new draft. Now time to experiment and get it to work!

One other question that occurs to me: you mentioned that I could have the Shortcut run and trash the draft, is it possible to have that happen without returning to Drafts? Maybe I’m doing something wrong, but a Shortcut I have run when I execute an Action will generate a PDF, which I save to a specific folder, and open a URL where I upload the meeting report PDF that I just generated, but then it returns me to Drafts.

This shortcut creates a new Draft in the inbox, then deletes it. All from within Shortcuts, without ducking out into the Drafts app.

https://www.icloud.com/shortcuts/1af9a071d91d4f63ada6ea3f7af0e0bf

Oh these are useful Shortcut components! Thanks!