Drafts Cult
5 subscribers
20 photos
3 videos
4 files
495 links
An *unofficial* resource for docs, updates, and tips for Drafts. https://getdrafts.com
Download Telegram
Posted by FlohGroInstall (drafts5://action?identifier=2EK&data=%7B%22notificationType%22:2,%22disposition%22:3,%22assignTags%22:%5B%5D,%22icon%22:%22action_reminders%22,%22groupDisposition%22:0,%22uuid%22:%22AF72424E-79EE-42AA-BF2E-F950E0CCA7DD%22,%22visibility%22:480,%22name%22:%22Reminders%20from%20lines%20in%20Draft%20with%20Options%22,%22groupUUID%22:%221741B889-EF47-41E4-863C-6D915D8C5519%22,%22tintColor%22:%22gray%22,%22backingPlatforms%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Reminders%20from%20lines%20in%20Draft%20with%20Options%22,%22shiftKey%22:false%7D,%22keyUseIcon%22:false,%22backingIsSeparator%22:false,%22shortName%22:%22%22,%22backingActionType%22:%22action%22,%22actionDescription%22:%22*created%20by%20%5B@FlohGro%5D(https://twitter.com/FlohGro)%20/%20more%20on%20my%20%5BBlog%5D(http://www.flohgro.com/)*%5Cn%5Cnadapted%20from%20this%20action:%20https://actions.getdrafts.com/a/1Rr%5Cn%5CnPrompt%20to%20create%20a%20reminder%20in%20the%20Reminders%20app%20with%20options%20to%20set%20due%20date,%20priority,%20and%20select%20the%20target%20list.%20%5CnEach%20line%20in%20the%20Draft%20will%20be%20considered%20as%20task%20(you%20can%20edit%20them%20in%20the%20prompt)%5Cn%5CnThe%20%E2%80%9CDue%E2%80%9D%20date%20field%20supports%20natural%20language%20parsing%20of%20dates,%20so%20things%20like%20%E2%80%9C2pm%20Friday%E2%80%9D,%20or%20%E2%80%9Cnext%20Wednesday%E2%80%9D%20work%20for%20specifying%20due%20date.%5Cn%5Cn---%5Cn%5Cn*If%20you%20find%20this%20useful%20and%20want%20to%20support%20me%20you%20can*%20%5Cn%5Cn%5Cu003ca%20href=%5C%22https://www.buymeacoffee.com/flohgro%5C%22%20target=%5C%22_blank%5C%22%5Cu003e%5Cu003cimg%20src=%5C%22https://cdn.buymeacoffee.com/buttons/v2/default-blue.png%5C%22%20alt=%5C%22Buy%20Me%20A%20Coffee%5C%22%20style=%5C%22height:%2051px%20!important;width:%20209px%20!important;%5C%22%20%5Cu003e%5Cu003c/a%5Cu003e%5Cn%22,%22logLevel%22:2,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22let%20f%20=%20()%20=%5Cu003e%20%7B%5Cn%5Ct//%20check%20if%20draft%20is%20empty%5Cn%5Ctif(draft.content.length%20==%200)%7B%5Cn%5Ctreturn%201;%5Cn%5Ctapp.displayInfoMessage(%5C%22draft%20is%20empty%5C%22)%5Cn%5Ct%7D%5Cn%5Ct//get%20array%20of%20tasks%20(each%20line)%5Cn%5Ctlet%20tasks%20=%20draft.content.split(%5C%22%5C%5Cn%5C%22);%5Cn%5Ct//%20get%20lists%5Cn%5Ctlet%20lists%20=%20ReminderList.getAllReminderLists();%5Cn%5Ctlet%20listNames%20=%20lists.map(x%20=%5Cu003e%20x.title);%5Cn%5Ctlet%20defaultList%20=%20ReminderList.default();%5Cn%5Ctlet%20defaultIndex%20=%20listNames.findIndex(x%20=%5Cu003e%20x%20==%20defaultList.title);%5Cn%5Ctlet%20createdRemCount%20=%200%5Cn%20%20%20for(task%20of%20tasks)%7B%5Cn%5Ctlet%20p%20=%20Prompt.create();%5Cn%5Ctp.title%20=%20%5C%22Create%20Reminder%5C%22%5Cn%5Ctp.message%20=%20%5C%22Select%20options%20for%20new%20task%20below.%5C%22;%5Cn%5Ct%5Cn%5Ctp.addTextField(%5C%22title%5C%22,%20%5C%22Title%5C%22,%20task,%20%7B%7D);%5Cn%5Ctp.addTextField(%5C%22dueDate%5C%22,%20%5C%22Due%5C%22,%20%5C%22%5C%22,%20%7B%5Cn%5Ct%5Ct%5C%22placeholder%5C%22:%20%5C%22optional%20date%5C%22%5Cn%5Ct%7D);%5Cn%5Ctp.addPicker(%5C%22priority%5C%22,%20%5C%22Priority%5C%22,%20%5B%5B%5C%22None%5C%22,%20%5C%22Low%5C%22,%20%5C%22Medium%5C%22,%20%5C%22High%5C%22%5D%5D,%20%5B0%5D);%5Cn%5Ctp.addTextView(%5C%22notes%5C%22,%20%5C%22Notes%5C%22,%20%5C%22%5C%22,%20%7B%7D);%5Cn%5Ctp.addPicker(%5C%22list%5C%22,%20%5C%22List%5C%22,%20%5BlistNames%5D,%20%5BdefaultIndex%5D);%5Cn%5Ct%5Cn%5Ctp.addButton(%5C%22Create%20Reminder%5C%22);%5Cn%5Ctif%20(!p.show())%20%7B%5Cn%5Ct%5Ctreturn%201;%5Cn%5Ct%20%20%20app.displayInfoMessage(%5C%22aborted%20by%20user%5C%22)%5Cn%5Ct%7D%5Cn%5Ct%5Cn%5Ctlet%20selectedListIndex%20=%20p.fieldValues%5B%5C%22list%5C%22%5D;%5Cn%5Ctlet%20list%20=%20lists%5BselectedListIndex%5D;%5Cn%5Ctlet%20rem%20=%20list.createReminder();%5Cn%5Ct%5Cn%5Ctrem.title%20=%20p.fieldVal
ues%5B%5C%22title%5C%22%5D;%5Cn%5Ctrem.notes%20=%20p.fieldValues%5B%5C%22notes%5C%22%5D;%5Cn%5Ctlet%20dStr%20=%20p.fieldValues%5B%5C%22dueDate%5C%22%5D;%5Cn%5Ctif%20(dStr%20%5Cu0026%5Cu0026%20dStr.length%20%5Cu003e%200)%20%7B%5Cn%5Ct%5Ctrem.dueDate%20=%20Date.parse(dStr);%5Cn%5Ct%7D%5Cn%5Ctlet%20priority%20=%20p.fieldValues%5B%5C%22priority%5C%22%5D;%5Cn%5Ctif%20(priority%20==%201)%20%7B%5Cn%5Ct%5Ctrem.priority%20=%209;%5Cn%5Ct%7D%5Cn%5Ctelse%20if%20(priority%20==%202)%20%7B%5Cn%5Ct%5Ctrem.priority%20=%205;%5Cn%5Ct%7D%5Cn%5Ctelse%20if%20(priority%20==%203)%20%7B%5Cn%5Ct%5Ctrem.priority%20=%201;%5Cn%5Ct%7D%5Cn%5Ctelse%20%7B%5Cn%5Ct%5Ctrem.priority%20=%200;%5Cn%5Ct%7D%5Cn%5Ctif%20(rem.update())%20%7B%5Cn%5Ct%5Ctconsole.log(%5C%22Reminder%20created%5C%22);%5Cn%5Ct%7D%5Cn%5Ctelse%20%7B%5Cn%5Ct%5Ctconsole.log(%5C%22Error%20creating%20reminder%5C%22);%5Cn%5Ct%5Ctreturn%20-1;%5Cn%5Ct%7D%5Cn%5CtcreatedRemCount++;%5Cn%5Ct%7D%5Cn%5Cn%5Ctreturn%20createdRemCount;%5Cn%7D%5Cn%5Cnlet%20result%20=%20f();%5Cnswitch%20(result)%20%7B%5Cn%5Ctcase%20-1:%20context.fail();%20break;%5Cn%5Ctcase%201:%20context.cancel();%20break;%5Cn%5Ctdefault:%20app.displaySuccessMessage(%5C%22created%20%5C%22%20+%20result%20+%20%5C%22%20reminders%5C%22)%5Cn%7D%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22BCAFE48F-658E-4FB2-9704-30DCEA2CAFC2%22%7D%5D,%22shouldConfirm%22:false%7D)
Remind Me Tomorrow
https://actions.getdrafts.com/a/2EL

Create a reminder from the current draft with an alarm at 09:00 tomorrow.

github.com/ernstwi/drafts-actions (https://github.com/ernstwi/drafts-actions)
Posted by ernstwiInstall (drafts5://action?identifier=2EL&data=%7B%22uuid%22:%2291778DEF-7720-4B25-A1F8-921B46E0DC68%22,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22let%20title%20=%20draft.processTemplate(%5C%22%5B%5Btitle%5D%5D%5C%22);%5Cnlet%20notes%20=%20draft.processTemplate(%5C%22%5B%5Bbody%5D%5D%5C%22);%5Cn%5Cnlet%20rem%20=%20ReminderList.default().createReminder();%5Cnrem.title%20=%20title;%5Cnrem.notes%20=%20%60%24%7Bnotes%7D%5C%5Cn%5C%5Cndrafts://x-callback-url/open?uuid=%24%7Bdraft.uuid%7D%60;%5Cnlet%20date%20=%20new%20Date();%5Cndate.setDate(date.getDate()%20+%201);%5Cndate.setHours(9,%200,%200);%5Cnrem.addAlarm(Alarm.alarmWithDate(date));%5Cnif%20(!rem.update())%20context.fail();%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22BCB7AF11-7598-4176-9880-464373256D5E%22%7D%5D,%22backingPlatforms%22:3,%22shortName%22:%22%22,%22shouldConfirm%22:false,%22disposition%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Remind%20Me%20Tomorrow%22,%22shiftKey%22:false%7D,%22logLevel%22:2,%22groupDisposition%22:0,%22notificationType%22:2,%22tintColor%22:%22none%22,%22actionDescription%22:%22%22,%22keyUseIcon%22:false,%22icon%22:%22action_right%22,%22visibility%22:480,%22backingIsSeparator%22:false,%22groupUUID%22:%227C1211EB-D1B0-43E8-A43D-25B15A5EE346%22,%22assignTags%22:%5B%5D,%22name%22:%22Remind%20Me%20Tomorrow%22%7D)
Share with schof.link
https://actions.getdrafts.com/a/2EN

Shares a markdown document using Schof.link, giving it a public link you can share.
Posted by ThomasInstall (drafts5://action?identifier=2EN&data=%7B%22notificationType%22:2,%22disposition%22:3,%22assignTags%22:%5B%5D,%22icon%22:%22btn-linkmode-selected%22,%22groupDisposition%22:0,%22uuid%22:%22D0591641-8AF9-46D6-8FDD-9FC04EDFD5D9%22,%22visibility%22:480,%22name%22:%22Share%20with%20schof.link%22,%22groupUUID%22:%22146CB07C-9612-4B5E-961C-870B9DACD6F2%22,%22tintColor%22:%22pink%22,%22backingPlatforms%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Share%20with%20schof.link%22,%22shiftKey%22:false%7D,%22keyUseIcon%22:true,%22backingIsSeparator%22:false,%22shortName%22:%22Schof.link%22,%22backingActionType%22:%22action%22,%22actionDescription%22:%22%22,%22logLevel%22:2,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22var%20http%20=%20HTTP.create();%5Cnvar%20response%20=%20http.request(%7B%5Cn%20%20%5C%22url%5C%22:%20%5C%22https://schof.link/api/md%5C%22,%5Cn%20%20%5C%22method%5C%22:%20%5C%22POST%5C%22,%5Cn%20%20%5C%22data%5C%22:%20%7B%5Cn%20%20%20%20%5C%22content%5C%22:draft.content%5Cn%20%20%7D%5Cn%7D);%5Cn%5Cnif%20(response.success)%20%7B%5Cn%20%20var%20data%20=%20response.responseData;%5Cn%20%20app.setClipboard(data.publicUrl);%5Cn%7D%5Cnelse%20%7B%5Cn%20%20console.log(response.statusCode);%5Cn%20%20console.log(response.error);%5Cn%7D%5Cn%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%222B4E6976-6937-4ADA-AF38-B5EE513804A7%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22useSafari%22:%22false%22,%22encodeTags%22:%22false%22,%22template%22:%22%5B%5Bclipboard%5D%5D%22%7D,%22type%22:%22url%22,%22isEnabled%22:true,%22uuid%22:%22B90581BE-D4F9-4A52-84DC-F3B90D970659%22%7D%5D,%22shouldConfirm%22:false%7D)
Add to Obsidian Daily Note
https://actions.getdrafts.com/a/2EO

created by @FlohGro (https://twitter.com/FlohGro) / more on my Website (http://www.flohgro.com/)

Add to Obsidian Daily Note

This action will add the contents of the current draft to the todays Daily Note in Obsidian.

You can choose if the action should append or prepend the content and if you want to add a text prefix (e.g. to add a todo or a bullet point to the daily note). If you want to use different prefixes, you can duplicate the action and configure and rename the duplicate accordingly.

[Configuration]

Before you can use the action you need to configure it depending on your setup in Obsidian and personal preference.

All configuration parameters are adapted in the „Define Template Tag“ steps in the Action. To change the configurations edit them to match your setup - don’t change the names of the template tags since the action won’t work anymore afterwards. The following parameters must be adapted:


obsidianVaultBookmarkName: the name of the folder bookmark that will be created to access the files in your vault (see the Drafts documentation for more information about Folder Bookmarks (https://docs.getdrafts.com/docs/settings/bookmarks)). When you run the Action the first time it should prompt you to select a folder for that bookmark. Default: Obsidian Vault
dateFormat: the date format of your daily notes in Obsidian. You need to use the Drafts specific notation documented here (https://docs.getdrafts.com/docs/actions/templates/drafts-templates#dates-and-times) Default: %Y-%m-%d which matches YYYY-MM-DD in Obsidian
dailyNotesFolderPath: the path where obsidian creates the daily notes (matches the setting for „New file location“ in the daily notes settings section). Default: empty
textAddPrefix: an optional prefix that will be prepended to the content of the Draft
textAddMode: you can choose if the action should prepend or append the draft to the daily note - only prepend or append are allowed. Default: append


IMPORTANT: If you‘re running the Action the first time and it shows an error that the file is not existing even when the file exists in Obsidian then please go into the Settings of Drafts, navigate to „Bookmarks“ and make sure that the configured bookmark name is not set to „-unknown-“. If it is set to Unknown then tap „Select Folder“ and navigate to your Obsidian Vault in the files UI, select it and tap „Done“ in the upper right corner.

[Usage]

The action directly accessed the files so Obsidian won’t be opened when adding something to the daily note. If you didn’t open obsidian on that day, the daily note file will not be created or synced into the folder. Make sure to open Obsidian on the device if you see the alert that the file is missing. This is to prevent sync issues and ensure that potential templates for daily notes are applied first.

Simply run the the Action to add the content of the current draft to your Daily Note in Obsidian. When you e.g. want to use the Action to add tasks to your Daily Note then you need to configure - [ ] as textAddPrefix. If you have different usecases, just duplicate the Action and configure it differently.



If you find this useful and want to support me you can
Posted by FlohGroInstall (drafts5://action?identifier=2EO&data=%7B%22uuid%22:%2238D957D8-D65D-4414-BE7B-F219290BAE3C%22,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22template%22:%22Obsidian%20Vault%22,%22name%22:%22obsidianVaultBookmarkName%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22E7331AB6-C22A-469C-B08F-194CDFF22B92%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22dateFormat%22,%22template%22:%22%25Y-%25m-%25d%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22A154AB12-F824-4B15-9B76-6D8FF311553F%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22dailyNotesFolderPath%22,%22template%22:%22%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22EC2F49E8-C747-4BDA-B94C-8A414D97CE01%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22textAddPrefix%22,%22template%22:%22%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22CF2C368A-0F06-4DCF-BC10-9E8160EF9572%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22textAddMode%22,%22template%22:%22append%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22ED60B798-CF54-41FF-9353-E7ABD01C00D1%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22//%20add%20to%20obsidian%20daily%20note%5Cn%5Cnconst%20obsidianVaultBookmarkName%20=%20draft.processTemplate(%5C%22%5B%5BobsidianVaultBookmarkName%5D%5D%5C%22)%5Cnconst%20dateFormat%20=%20draft.processTemplate(%5C%22%5B%5BdateFormat%5D%5D%5C%22);%5Cn%5Cnlet%20dailyNoteFileName%20=%20draft.processTemplate(%5C%22%5B%5Bdate%7C%5C%22%20+%20dateFormat%20+%20%5C%22%5D%5D%5C%22)%20+%20%5C%22.md%5C%22;%5Cn%5Cnlet%20dailyNotesFolderPath%20=%20draft.processTemplate(%5C%22%5B%5BdailyNotesFolderPath%5D%5D%5C%22)%20+%20%5C%22/%5C%22;%5Cn%5CndailyNoteFileName%20=%20dailyNotesFolderPath%20+%20dailyNoteFileName%20//%5C%222022%5C%5C.10%5C%5C.25.md%5C%22%5Cnlet%20bookmark%20=%20Bookmark.findOrCreate(obsidianVaultBookmarkName);%5Cn%5Cn%5Cnconst%20configEntryPrefix%20=%20%5C%22-%20%5C%22%5Cnconst%20textAddPrefix%20=%20draft.processTemplate(%5C%22%5B%5BtextAddPrefix%5D%5D%5C%22);%5Cnconst%20textAddMode%20=%20draft.processTemplate(%5C%22%5B%5BtextAddMode%5D%5D%5C%22);%5Cn%5Cnlet%20fm%20=%20FileManager.createForBookmark(bookmark);%5Cn%5Cnif%20(fm.exists(dailyNoteFileName))%20%7B%5Cn%20%20%20%20//%20file%20exists%5Cn%20%20%20%20let%20fileContent%20=%20fm.readString(dailyNoteFileName)%5Cn%20%20%20%20if%20(textAddMode%20==%20%5C%22append%5C%22)%20%7B%5Cn%20%20%20%20%20%20%20%20fileContent%20=%20fileContent%20+%20%5C%22%5C%5Cn%5C%22%20+%20textAddPrefix%20+%20draft.content%5Cn%20%20%20%20%7D%20else%20if%20(textAddMode%20==%20%5C%22prepend%5C%22)%20%7B%5Cn%20%20%20%20%20%20%20%20fileContent%20=%20textAddPrefix%20+%20draft.content%20+%20%5C%22%5C%5Cn%5C%22%20+%20fileContent%5Cn%20%20%20%20%7D%20else%20%7B%5Cn%20%20%20%20%20%20%20%20console.log(%5C%22invalid%20text%20add%20mode%5C%22)%5Cn%20%20%20%20%20%20%20%20alert(%5C%22invalid%20text%20add%20mode%20configured%20-%20only%20%5C%5C%5C%22append%5C%5C%5C%22%20or%20%5C%5C%5C%22prepend%5C%5C%5C%22%20are%20allowed%5C%22)%5Cn%20%20%20%20%20%20%20%20context.fail()%5Cn%20%20%20%20%7D%5Cn%20%20%20%20if%20(!fm.writeString(dailyNoteFileName,%20fileContent))%20%7B%5Cn%20%20%20%20%20%20%20%20console.log(%5C%22failed%20writing%20content%20to%20file%5C%22)%5Cn%20%20%20%20%20%20%20%20alert(%5C%22failed%20writing%20content%20to%20file%20-%20this%20should%20not%20happen.%20please%20contact%20FlohGro%20via%20Twitter%20or%20the%20Drafts%20Forum.%5C%22)%5Cn%20%20%20%20%20%20%20%20context.fail()%5Cn%20%20%20%20%7D%5Cn%5Cn%7D%20else%20%7B%5Cn%20%20%20%20//%20file%20does%20note%20exist%5Cn%20%20%20%20console.log(%5C%22daily%20notes%20file%20does%20not%20(yet)%20exist%5C%22)%5Cn%20%20%20%20alert(%5C%22daily%20notes%20file%20does%20not%20(yet
)%20exist,%20create%20it%20in%20obsidian%5C%22)%5Cn%20%20%20%20context.fail()%5Cn%7D%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22313D5F79-49D4-4D10-828C-674D64FFD292%22%7D%5D,%22backingPlatforms%22:3,%22shortName%22:%22%22,%22shouldConfirm%22:false,%22disposition%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Add%20to%20Obsidian%20Daily%20Note%22,%22shiftKey%22:false%7D,%22logLevel%22:2,%22groupDisposition%22:0,%22notificationType%22:2,%22tintColor%22:%22violet%22,%22actionDescription%22:%22*created%20by%20%5B@FlohGro%5D(https://twitter.com/FlohGro)%20/%20more%20on%20my%20%5BWebsite%5D(http://www.flohgro.com/)*%5Cn%5Cn%23%23%20Add%20to%20Obsidian%20Daily%20Note%5Cn%5CnThis%20action%20will%20add%20the%20contents%20of%20the%20current%20draft%20to%20the%20todays%20Daily%20Note%20in%20Obsidian.%5CnYou%20can%20choose%20if%20the%20action%20should%20append%20or%20prepend%20the%20content%20and%20if%20you%20want%20to%20add%20a%20text%20prefix%20(e.g.%20to%20add%20a%20todo%20or%20a%20bullet%20point%20to%20the%20daily%20note).%20If%20you%20want%20to%20use%20different%20prefixes,%20you%20can%20duplicate%20the%20action%20and%20configure%20and%20rename%20the%20duplicate%20accordingly.%5Cn%5Cn%23%23%20%5BConfiguration%5D%5Cn%5CnBefore%20you%20can%20use%20the%20action%20you%20need%20to%20configure%20it%20depending%20on%20your%20setup%20in%20Obsidian%20and%20personal%20preference.%5Cn%5CnAll%20configuration%20parameters%20are%20adapted%20in%20the%20%E2%80%9EDefine%20Template%20Tag%E2%80%9C%20steps%20in%20the%20Action.%20To%20change%20the%20configurations%20edit%20them%20to%20match%20your%20setup%20-%20don%E2%80%99t%20change%20the%20names%20of%20the%20template%20tags%20since%20the%20action%20won%E2%80%99t%20work%20anymore%20afterwards.%20The%20following%20parameters%20must%20be%20adapted:%5Cn%5Cn-%20%60obsidianVaultBookmarkName%60:%20the%20name%20of%20the%20folder%20bookmark%20that%20will%20be%20created%20to%20access%20the%20files%20in%20your%20vault%20(see%20the%20Drafts%20documentation%20for%20more%20information%20about%20%5BFolder%20Bookmarks%5D(https://docs.getdrafts.com/docs/settings/bookmarks)).%20When%20you%20run%20the%20Action%20the%20first%20time%20it%20should%20prompt%20you%20to%20select%20a%20folder%20for%20that%20bookmark.%20Default:%20%60Obsidian%20Vault%60%5Cn-%20%60dateFormat%60:%20the%20date%20format%20of%20your%20daily%20notes%20in%20Obsidian.%20You%20need%20to%20use%20the%20Drafts%20specific%20notation%20documented%20%5Bhere%5D(https://docs.getdrafts.com/docs/actions/templates/drafts-templates%23dates-and-times)%20Default:%20%60%25Y-%25m-%25d%60%20which%20matches%20%60YYYY-MM-DD%60%20in%20Obsidian%5Cn-%20%60dailyNotesFolderPath%60:%20the%20path%20where%20obsidian%20creates%20the%20daily%20notes%20(matches%20the%20setting%20for%20%E2%80%9ENew%20file%20location%E2%80%9C%20in%20the%20daily%20notes%20settings%20section).%20Default:%20%60empty%60%5Cn-%20%60textAddPrefix%60:%20an%20optional%20prefix%20that%20will%20be%20prepended%20to%20the%20content%20of%20the%20Draft%5Cn-%20%60textAddMode%60:%20you%20can%20choose%20if%20the%20action%20should%20prepend%20or%20append%20the%20draft%20to%20the%20daily%20note%20-%20only%20%60prepend%60%20or%20%60append%60%20are%20allowed.%20Default:%20%60append%60%5Cn%5Cn**IMPORTANT:**%20If%20you%E2%80%98re%20running%20the%20Action%20the%20first%20time%20and%20it%20shows%20an%20error%20that%20the%20file%20is%20not%20existing%20even%20when%20the%20file%20exists%20in%20Obsidian%20then%20please%20go%20into%20the%20Settings%20of%20Drafts,%20navigate%20to%20%E2%80%9EBookmarks%E2%80%9C%20and%20make%20sure%20that%20the%20configured%20bookmark%20name%20is%20not%20set%20to%20%E2%80%9E-unknown-%E2%80%9C.%20If%20it%20is%20set%20to%20Unknown%20then%20tap%20%E2%80%9ESelect%20Folder%E2%80%9C%20and%20navigate%20to%20your%20Obsidian%20Vault%20in%20the
%20files%20UI,%20select%20it%20and%20tap%20%E2%80%9EDone%E2%80%9C%20in%20the%20upper%20right%20corner.%5Cn%5Cn%23%23%20%5BUsage%5D%5Cn%5CnThe%20action%20directly%20accessed%20the%20files%20so%20Obsidian%20won%E2%80%99t%20be%20opened%20when%20adding%20something%20to%20the%20daily%20note.%20If%20you%20didn%E2%80%99t%20open%20obsidian%20on%20that%20day,%20the%20daily%20note%20file%20will%20not%20be%20created%20or%20synced%20into%20the%20folder.%20Make%20sure%20to%20open%20Obsidian%20on%20the%20device%20if%20you%20see%20the%20alert%20that%20the%20file%20is%20missing.%20This%20is%20to%20prevent%20sync%20issues%20and%20ensure%20that%20potential%20templates%20for%20daily%20notes%20are%20applied%20first.%5Cn%5CnSimply%20run%20the%20the%20Action%20to%20add%20the%20content%20of%20the%20current%20draft%20to%20your%20Daily%20Note%20in%20Obsidian.%20When%20you%20e.g.%20want%20to%20use%20the%20Action%20to%20add%20tasks%20to%20your%20Daily%20Note%20then%20you%20need%20to%20configure%20%60-%20%5B%20%5D%20%60%20as%20%60textAddPrefix%60.%20If%20you%20have%20different%20usecases,%20just%20duplicate%20the%20Action%20and%20configure%20it%20differently.%5Cn%5Cn%5Cn---%5Cn%5Cn*If%20you%20find%20this%20useful%20and%20want%20to%20support%20me%20you%20can*%20%5Cn%5Cn%5Cu003ca%20href=%5C%22https://www.buymeacoffee.com/flohgro%5C%22%20target=%5C%22_blank%5C%22%5Cu003e%5Cu003cimg%20src=%5C%22https://cdn.buymeacoffee.com/buttons/v2/default-blue.png%5C%22%20alt=%5C%22Buy%20Me%20A%20Coffee%5C%22%20style=%5C%22height:%2051px%20!important;width:%20209px%20!important;%5C%22%20%5Cu003e%5Cu003c/a%5Cu003e%22,%22keyUseIcon%22:false,%22icon%22:%22calendar-add%22,%22visibility%22:480,%22backingIsSeparator%22:false,%22groupUUID%22:%22FB0C2AD9-6BCB-40A3-99D4-6DBA6DF8D7BC%22,%22assignTags%22:%5B%5D,%22name%22:%22Add%20to%20Obsidian%20Daily%20Note%22%7D)
Add to Obsidian Daily Note Section
https://actions.getdrafts.com/a/2EP

created by @FlohGro (https://twitter.com/FlohGro) / more on my Website (http://www.flohgro.com/)

Add to Obsidian Daily Note Section

This action will add the contents of the current draft into the configured section in todays Daily Note in Obsidian.

If the configured section is not present, you can choose if the action should append or prepend the content. You can also configure if you want to add a text prefix (e.g. to add a todo or a bullet point to the daily note). If you want to use different prefixes, you can duplicate the action and configure and rename the duplicate accordingly.

[Configuration]

Before you can use the action you need to configure it depending on your setup in Obsidian and personal preference.

All configuration parameters are adapted in the „Define Template Tag“ steps in the Action. To change the configurations edit them to match your setup - don’t change the names of the template tags since the action won’t work anymore afterwards. The following parameters must be adapted:


obsidianVaultBookmarkName: the name of the folder bookmark that will be created to access the files in your vault (see the Drafts documentation for more information about Folder Bookmarks (https://docs.getdrafts.com/docs/settings/bookmarks)). When you run the Action the first time it should prompt you to select a folder for that bookmark. Default: Obsidian Vault
dateFormat: the date format of your daily notes in Obsidian. You need to use the Drafts specific notation documented here (https://docs.getdrafts.com/docs/actions/templates/drafts-templates#dates-and-times) Default: %Y-%m-%d which matches YYYY-MM-DD in Obsidian
dailyNotesFolderPath: the path where obsidian creates the daily notes (matches the setting for „New file location“ in the daily notes settings section). Default: empty
dailyNotesSection: the section in the daily note to where you want to add the content of the current draft. the section must be unique in the Daily Note. Default: UNCONFIGURED
textAddPrefix: an optional prefix that will be prepended to the content of the Draft


IMPORTANT: If you‘re running the Action the first time and it shows an error that the file is not existing even when the file exists in Obsidian then please go into the Settings of Drafts, navigate to „Bookmarks“ and make sure that the configured bookmark name is not set to „-unknown-“. If it is set to Unknown then tap „Select Folder“ and navigate to your Obsidian Vault in the files UI, select it and tap „Done“ in the upper right corner.

[Usage]

The action directly accessed the files so Obsidian won’t be opened when adding something to the daily note. If you didn’t open obsidian on that day, the daily note file will not be created or synced into the folder. Make sure to open Obsidian on the device if you see the alert that the file is missing. This is to prevent sync issues and ensure that potential templates for daily notes are applied first.

Simply run the the Action to add the content of the current draft into the configured section of your Daily Note in Obsidian. When you e.g. want to use the Action to add tasks to your Daily Note then you need to configure - [ ] as textAddPrefix. If you have different usecases, just duplicate the Action and configure it differently.



If you find this useful and want to support me you can
Posted by FlohGroInstall (drafts5://action?identifier=2EP&data=%7B%22notificationType%22:2,%22disposition%22:3,%22assignTags%22:%5B%5D,%22icon%22:%22calendar-next%22,%22groupDisposition%22:0,%22uuid%22:%22B9B43131-7009-4A40-8009-E226DBEB914E%22,%22visibility%22:480,%22name%22:%22Add%20to%20Obsidian%20Daily%20Note%20Section%22,%22groupUUID%22:%22FB0C2AD9-6BCB-40A3-99D4-6DBA6DF8D7BC%22,%22tintColor%22:%22violet%22,%22backingPlatforms%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Add%20to%20Obsidian%20Daily%20Note%20Section%22,%22shiftKey%22:false%7D,%22keyUseIcon%22:false,%22backingIsSeparator%22:false,%22shortName%22:%22%22,%22backingActionType%22:%22action%22,%22actionDescription%22:%22*created%20by%20%5B@FlohGro%5D(https://twitter.com/FlohGro)%20/%20more%20on%20my%20%5BWebsite%5D(http://www.flohgro.com/)*%5Cn%5Cn%23%23%20Add%20to%20Obsidian%20Daily%20Note%20Section%5Cn%5CnThis%20action%20will%20add%20the%20contents%20of%20the%20current%20draft%20into%20the%20configured%20section%20in%20todays%20Daily%20Note%20in%20Obsidian.%5CnIf%20the%20configured%20section%20is%20not%20present,%20you%20can%20choose%20if%20the%20action%20should%20append%20or%20prepend%20the%20content.%20You%20can%20also%20configure%20if%20you%20want%20to%20add%20a%20text%20prefix%20(e.g.%20to%20add%20a%20todo%20or%20a%20bullet%20point%20to%20the%20daily%20note).%20If%20you%20want%20to%20use%20different%20prefixes,%20you%20can%20duplicate%20the%20action%20and%20configure%20and%20rename%20the%20duplicate%20accordingly.%5Cn%5Cn%23%23%20%5BConfiguration%5D%5Cn%5CnBefore%20you%20can%20use%20the%20action%20you%20need%20to%20configure%20it%20depending%20on%20your%20setup%20in%20Obsidian%20and%20personal%20preference.%5Cn%5CnAll%20configuration%20parameters%20are%20adapted%20in%20the%20%E2%80%9EDefine%20Template%20Tag%E2%80%9C%20steps%20in%20the%20Action.%20To%20change%20the%20configurations%20edit%20them%20to%20match%20your%20setup%20-%20don%E2%80%99t%20change%20the%20names%20of%20the%20template%20tags%20since%20the%20action%20won%E2%80%99t%20work%20anymore%20afterwards.%20The%20following%20parameters%20must%20be%20adapted:%5Cn%5Cn-%20%60obsidianVaultBookmarkName%60:%20the%20name%20of%20the%20folder%20bookmark%20that%20will%20be%20created%20to%20access%20the%20files%20in%20your%20vault%20(see%20the%20Drafts%20documentation%20for%20more%20information%20about%20%5BFolder%20Bookmarks%5D(https://docs.getdrafts.com/docs/settings/bookmarks)).%20When%20you%20run%20the%20Action%20the%20first%20time%20it%20should%20prompt%20you%20to%20select%20a%20folder%20for%20that%20bookmark.%20Default:%20%60Obsidian%20Vault%60%5Cn-%20%60dateFormat%60:%20the%20date%20format%20of%20your%20daily%20notes%20in%20Obsidian.%20You%20need%20to%20use%20the%20Drafts%20specific%20notation%20documented%20%5Bhere%5D(https://docs.getdrafts.com/docs/actions/templates/drafts-templates%23dates-and-times)%20Default:%20%60%25Y-%25m-%25d%60%20which%20matches%20%60YYYY-MM-DD%60%20in%20Obsidian%5Cn-%20%60dailyNotesFolderPath%60:%20the%20path%20where%20obsidian%20creates%20the%20daily%20notes%20(matches%20the%20setting%20for%20%E2%80%9ENew%20file%20location%E2%80%9C%20in%20the%20daily%20notes%20settings%20section).%20Default:%20%60empty%60%5Cn-%20%60dailyNotesSection%60:%20the%20section%20in%20the%20daily%20note%20to%20where%20you%20want%20to%20add%20the%20content%20of%20the%20current%20draft.%20the%20section%20must%20be%20unique%20in%20the%20Daily%20Note.%20Default:%20%60UNCONFIGURED%60%5Cn-%20%60textAddPrefix%60:%20an%20optional%20prefix%20that%20will%20be%20prepended%20to%20the%20content%20of%20the%20Draft%5Cn%5Cn**IMPORTANT:**%20If%20you%E2%80%98re%20running%20the%20Action%20the%20first%20time%20and%20it%20shows%20an%20error%20that%20the%20file%20is%20not%20existing%20even%20when%20the%20file%20exists%20in%20Obsidian%20then%20please%20go%20into%20the%20Settings%20of%20Drafts,%20navigate%
20to%20%E2%80%9EBookmarks%E2%80%9C%20and%20make%20sure%20that%20the%20configured%20bookmark%20name%20is%20not%20set%20to%20%E2%80%9E-unknown-%E2%80%9C.%20If%20it%20is%20set%20to%20Unknown%20then%20tap%20%E2%80%9ESelect%20Folder%E2%80%9C%20and%20navigate%20to%20your%20Obsidian%20Vault%20in%20the%20files%20UI,%20select%20it%20and%20tap%20%E2%80%9EDone%E2%80%9C%20in%20the%20upper%20right%20corner.%5Cn%5Cn%23%23%20%5BUsage%5D%5Cn%5CnThe%20action%20directly%20accessed%20the%20files%20so%20Obsidian%20won%E2%80%99t%20be%20opened%20when%20adding%20something%20to%20the%20daily%20note.%20If%20you%20didn%E2%80%99t%20open%20obsidian%20on%20that%20day,%20the%20daily%20note%20file%20will%20not%20be%20created%20or%20synced%20into%20the%20folder.%20Make%20sure%20to%20open%20Obsidian%20on%20the%20device%20if%20you%20see%20the%20alert%20that%20the%20file%20is%20missing.%20This%20is%20to%20prevent%20sync%20issues%20and%20ensure%20that%20potential%20templates%20for%20daily%20notes%20are%20applied%20first.%5Cn%5CnSimply%20run%20the%20the%20Action%20to%20add%20the%20content%20of%20the%20current%20draft%20into%20the%20configured%20section%20of%20your%20Daily%20Note%20in%20Obsidian.%20When%20you%20e.g.%20want%20to%20use%20the%20Action%20to%20add%20tasks%20to%20your%20Daily%20Note%20then%20you%20need%20to%20configure%20%60-%20%5B%20%5D%20%60%20as%20%60textAddPrefix%60.%20If%20you%20have%20different%20usecases,%20just%20duplicate%20the%20Action%20and%20configure%20it%20differently.%5Cn%5Cn%5Cn---%5Cn%5Cn*If%20you%20find%20this%20useful%20and%20want%20to%20support%20me%20you%20can*%20%5Cn%5Cn%5Cu003ca%20href=%5C%22https://www.buymeacoffee.com/flohgro%5C%22%20target=%5C%22_blank%5C%22%5Cu003e%5Cu003cimg%20src=%5C%22https://cdn.buymeacoffee.com/buttons/v2/default-blue.png%5C%22%20alt=%5C%22Buy%20Me%20A%20Coffee%5C%22%20style=%5C%22height:%2051px%20!important;width:%20209px%20!important;%5C%22%20%5Cu003e%5Cu003c/a%5Cu003e%22,%22logLevel%22:2,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22obsidianVaultBookmarkName%22,%22template%22:%22Obsidian%20Vault%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22D97F4D9B-E41E-427E-9B6A-CB8F2B35B5BC%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22template%22:%22%25Y-%25m-%25d%22,%22name%22:%22dateFormat%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22CCD6CF1B-2C34-41DE-805F-3DB08B7B9D54%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22template%22:%22%22,%22name%22:%22dailyNotesFolderPath%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22DB22CF40-11F5-4D81-B97C-1C3F903BF683%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22name%22:%22dailyNotesSection%22,%22template%22:%22UNCONFIGURED%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22F13B536A-E32E-4F5B-98EA-C698D2580F68%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22template%22:%22%22,%22name%22:%22textAddPrefix%22,%22templateType%22:%22legacy%22%7D,%22type%22:%22defineTemplateTag%22,%22isEnabled%22:true,%22uuid%22:%22D0B977AC-8B95-41B0-89B7-F7D0A0E2E3FE%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22//%20add%20to%20section%20in%20obsidian%20daily%20note%5Cn%5Cnconst%20obsidianVaultBookmarkName%20=%20draft.processTemplate(%5C%22%5B%5BobsidianVaultBookmarkName%5D%5D%5C%22)%5Cnconst%20dateFormat%20=%20draft.processTemplate(%5C%22%5B%5BdateFormat%5D%5D%5C%22);%5Cn%5Cnlet%20dailyNoteFileName%20=%20draft.processTemplate(%5C%22%5B%5Bdate%7C%5C%22%20+%20dateFormat%20+%20%5C%22%5D%5D%5C%22)%20+%20%5C%22.md%5C%22;%5Cn%5Cnconst%20dailyNotesFolderPath%20=%20draft.processTemplate(%5C%22%5B%5BdailyNotesFolderPath%5D%5D%5C%22)%20+%20%5C%22/%5C%22;%5Cnconst%20dailyNoteSection%20=%20draft.processTemplate(%5C%22%5B%5BdailyNotesSection%5D%5D%5C%22)%20+%20%5C%22%5C%5Cn%5C%22;%5Cn%5Cn%5CndailyNoteFileName%20=%20dailyNotesFolderPath%20+%20dailyNoteFile
Name%20//%5C%222022%5C%5C.10%5C%5C.25.md%5C%22%5Cnlet%20bookmark%20=%20Bookmark.findOrCreate(obsidianVaultBookmarkName);%5Cn%5Cn%5Cnconst%20configEntryPrefix%20=%20%5C%22-%20%5C%22%5Cnconst%20textAddPrefix%20=%20draft.processTemplate(%5C%22%5B%5BtextAddPrefix%5D%5D%5C%22);%5Cnconst%20textAddMode%20=%20draft.processTemplate(%5C%22%5B%5BtextAddMode%5D%5D%5C%22);%5Cn%5Cnlet%20fm%20=%20FileManager.createForBookmark(bookmark);%5Cn%5Cnif%20(fm.exists(dailyNoteFileName))%20%7B%5Cn%20%20%20%20//%20file%20exists%5Cn%20%20%20%20let%20fileContent%20=%20fm.readString(dailyNoteFileName)%5Cn%20%20%20%20let%20splits%20=%20fileContent.split(dailyNoteSection)%5Cn%5Cn%20%20%20%20let%20adaptFileContent%20=%20true;%5Cn%20%20%20%20if%20(splits.length%20==%202)%20%7B%5Cn%20%20%20%20%20%20%20%20//%20the%20section%20is%20found%5Cn%20%20%20%20%20%20%20%20splits%5B1%5D%20=%20%5C%22%5C%5Cn%5C%22%20+%20draft.content%20+%20%5C%22%5C%5Cn%5C%22%20+%20splits%5B1%5D%5Cn%5Cn%20%20%20%20%20%20%20%20fileContent%20=%20splits.join(dailyNoteSection);%5Cn%5Cn%20%20%20%20%7D%20else%20if%20(splits.length%20==%201)%20%7B%5Cn%20%20%20%20%20%20%20%20//%20the%20configured%20section%20was%20not%20found%20in%20the%20daily%20note%20let%20the%20user%20decide%20what%20to%20do:%5Cn%20%20%20%20%20%20%20%20let%20p%20=%20new%20Prompt()%5Cn%20%20%20%20%20%20%20%20p.title%20=%20%5C%22Section%20not%20existing%5C%22%5Cn%20%20%20%20%20%20%20%20p.message%20=%20%5C%22the%20configured%20section%20%5C%22%20+%20dailyNoteSection%20+%20%5C%22%20is%20not%20existing%20in%20the%20Daily%20Note%20right%20now.%20Select%20one%20of%20the%20following%20options:%5C%22%5Cn%20%20%20%20%20%20%20%20p.addButton(%5C%22append%20draft%20to%20Daily%20Note%5C%22,%201)%5Cn%20%20%20%20%20%20%20%20p.addButton(%5C%22prepend%20draft%20to%20Daily%20Note%5C%22,%202)%5Cn%20%20%20%20%20%20%20%20p.addButton(%5C%22abort%20adding%20draft%20to%20Daily%20Note%5C%22,%200)%5Cn%20%20%20%20%20%20%20%20p.isCancellable%20=%20false%5Cn%5Cn%20%20%20%20%20%20%20%20p.show()%5Cn%5Cn%20%20%20%20%20%20%20%20switch%20(p.buttonPressed)%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20case%200:%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20context.cancel(%5C%22aborted%20by%20user%5C%22);%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20app.displayWarningMessage(%5C%22Aborted%20adding%20to%20Daily%20Note%5C%22);%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cn%20%20%20%20%20%20%20%20%20%20%20%20case%201:%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileContent%20=%20fileContent%20+%20%5C%22%5C%5Cn%5C%5Cn%5C%22%20+%20draft.content;%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cn%20%20%20%20%20%20%20%20%20%20%20%20case%202:%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fileContent%20=%20draft.content%20+%20%5C%22%5C%5Cn%5C%5Cn%5C%22%20+%20fileContent;%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break;%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%20else%20if%20(splits.length%20%5Cu003e%202)%20%7B%5Cn%20%20%20%20%20%20%20%20//%20section%20is%20found%20multiple%20time,%20user%20should%20clean%20up%5Cn%20%20%20%20%20%20%20%20const%20errorStr%20=%20%5C%22Section%20%5C%5C%5C%22%5C%22%20+%20dailyNoteSection%20+%20%5C%22%5C%5C%5C%22%20was%20found%20multiple%20times%20in%20the%20Daily%20Note.%20Clean%20up%20this%20mess%20and%20try%20again%5C%22%5Cn%20%20%20%20%20%20%20%20context.fail(errorStr)%5Cn%20%20%20%20%20%20%20%20alert(%5C%22Error:%5C%5Cn%5C%22%20+%20errorStr)%5Cn%20%20%20%20%20%20%20%20adaptFileContent%20=%20false;%5Cn%20%20%20%20%7D%5Cn%20%20%20%20if%20(adaptFileContent)%20%7B%5Cn%5Cn%20%20%20%20%20%20%20%20if%20(!fm.writeString(dailyNoteFileName,%20fileContent))%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20console.log(%5C%22failed%20writing%20content%20to%20file%5C%22)%5Cn%20%20%20%20%20%20%20%20%20%20%20%20alert(%5C%22failed%20writing%20content%20to%20file%20-%20this%20should%20not%20happen.%20please%20contact%20FlohGro%20via%20Twitter%20or%20the%20Drafts%20Forum.%5C%22)%5Cn%20%20%20%20%20
%20%20%20%20%20%20%20context.fail()%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%5Cn%7D%20else%20%7B%5Cn%20%20%20%20//%20file%20does%20note%20exist%5Cn%20%20%20%20console.log(%5C%22daily%20notes%20file%20does%20not%20(yet)%20exist%5C%22)%5Cn%20%20%20%20alert(%5C%22daily%20notes%20file%20does%20not%20(yet)%20exist,%20create%20it%20in%20obsidian%5C%22)%5Cn%20%20%20%20context.fail()%5Cn%7D%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22A810EF73-DA82-4E31-AFDD-BB8CE812E483%22%7D%5D,%22shouldConfirm%22:false%7D)
BelleÎle Dark
https://actions.getdrafts.com/t/2EQ

meditative for dark times
Install (x-drafts://importtheme?identifier=2EQ&data=%7B%22isHidden%22:false,%22source%22:%22%7B%5C%22name%5C%22:%5C%22Belle%C3%8Ele%20Dark%5C%22,%5C%22author%5C%22:%5C%22du%20Greg%20modifi%C3%A9%20%C3%A0%20la%20louche%20par%20urbanbike%20pour%20%C3%A9crire%20en%20Markdown,%20sans%20garantie%20de%20bugs%20ou%20d)
Post: Twitter+Mastodon
https://actions.getdrafts.com/a/2ER

Post draft to both Twitter & Mastodon. This combines a Twitter action step, with a script that posts to the Mastodon API.

To use this action, you must create an application in your Mastodon account to obtain an access token. To do so (if you have already configured the Post to Mastodon (https://directory.getdrafts.com/a/1v8) action, you do not need to repeat these steps):


Go to your Mastodon account preferences page.
Click on “Development”
On the Development page, click “New Application” and configure values. You will not be using OAuth, so you need only configure a name, and make sure the application has at least the write:statuses scope selected.
After saving changes, click on the application details and copy the “Your access token” value. This will be used as the token value the first time you run this action.


With that information complete, run the action. The first time you run it, you will be prompted to enter the token you obtained above, and the base URL of your Mastodon instance, which should be something like https://mastodon.social/(include trailing slash). These values will be remembered for subsequent use of the action.
Posted by agiletortoiseInstall (drafts5://action?identifier=2ER&data=%7B%22notificationType%22:2,%22disposition%22:1,%22assignTags%22:%5B%22tweet%22,%22mastodon%22%5D,%22icon%22:%22chat-message%22,%22groupDisposition%22:0,%22uuid%22:%222291FD94-62E8-4093-BC9D-6038CCF0A63C%22,%22visibility%22:480,%22name%22:%22Post:%20Twitter+Mastodon%22,%22groupUUID%22:%222D7673A0-5E26-4816-9377-FF306F7E4874%22,%22tintColor%22:%22blue%22,%22backingPlatforms%22:3,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Post:%20Twitter+Mastodon%22,%22shiftKey%22:false%7D,%22keyUseIcon%22:false,%22backingIsSeparator%22:false,%22shortName%22:%22%22,%22backingActionType%22:%22action%22,%22actionDescription%22:%22Post%20draft%20to%20both%20Twitter%20%5Cu0026%20Mastodon.%20This%20combines%20a%20Twitter%20action%20step,%20with%20a%20script%20that%20posts%20to%20the%20Mastodon%20API.%5Cn%5CnTo%20use%20this%20action,%20you%20must%20create%20an%20application%20in%20your%20Mastodon%20account%20to%20obtain%20an%20access%20token.%20To%20do%20so%20(if%20you%20have%20already%20configured%20the%20%5BPost%20to%20Mastodon%5D(https://directory.getdrafts.com/a/1v8)%20action,%20you%20do%20not%20need%20to%20repeat%20these%20steps):%5Cn%5Cn*%20Go%20to%20your%20Mastodon%20account%20preferences%20page.%5Cn*%20Click%20on%20%E2%80%9CDevelopment%E2%80%9D%5Cn*%20On%20the%20Development%20page,%20click%20%E2%80%9CNew%20Application%E2%80%9D%20and%20configure%20values.%20You%20will%20not%20be%20using%20OAuth,%20so%20you%20need%20only%20configure%20a%20name,%20and%20make%20sure%20the%20application%20has%20at%20least%20the%20%60write:statuses%60%20scope%20selected.%5Cn*%20After%20saving%20changes,%20click%20on%20the%20application%20details%20and%20copy%20the%20%E2%80%9CYour%20access%20token%E2%80%9D%20value.%20This%20will%20be%20used%20as%20the%20%60token%60%20value%20the%20first%20time%20you%20run%20this%20action.%5Cn%5CnWith%20that%20information%20complete,%20run%20the%20action.%20The%20first%20time%20you%20run%20it,%20you%20will%20be%20prompted%20to%20enter%20the%20token%20you%20obtained%20above,%20and%20the%20base%20URL%20of%20your%20Mastodon%20instance,%20which%20should%20be%20something%20like%20%60https://mastodon.social/%60(include%20trailing%20slash).%20These%20values%20will%20be%20remembered%20for%20subsequent%20use%20of%20the%20action.%22,%22logLevel%22:2,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22template%22:%22%5B%5Bdraft%5D%5D%22,%22oauthIdentifier%22:%22%22%7D,%22type%22:%22twitter%22,%22isEnabled%22:true,%22uuid%22:%2227179247-9669-4BF3-BBDF-790DA9387BCA%22%7D,%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22//%20setup%20and%20request%20credentials%5Cnlet%2
0credential%20=%20Credential.create(%5C%22Mastodon%5C%22,%20%5C%22Enter%20the%20base%20URL%20of%20your%20Mastodon%20instance%20(like:%20https://mastodon.social),%20and%20a%20valid%20access%20token%20for%20an%20application%20you%20have%20created%20in%20your%20account.%5C%22);%5Cn%5Cncredential.addTextField(%5C%22host%5C%22,%20%5C%22Base%20URL%5C%22);%5Cncredential.addPasswordField(%5C%22token%5C%22,%20%5C%22Access%20Token%5C%22);%5Cncredential.authorize();%5Cn%5Cnconst%20host%20=%20credential.getValue(%5C%22host%5C%22);%5Cnconst%20token%20=%20credential.getValue(%5C%22token%5C%22);%5Cn%5Cn//%20make%20post%5Cnlet%20endpoint%20=%20%60%24%7Bhost%7Dapi/v1/statuses%60;%5Cnvar%20id_key%20=%20new%20Date().toISOString();%5Cn%5Cn//%20configure%20status%20details%5Cn//%20for%20more%20info%20on%20options%20see:%5Cn//%20https://docs.joinmastodon.org/methods/statuses/%5Cnlet%20data%20=%20%7B%5Cn%5Ct%5C%22status%5C%22:%20draft.content,%5Cn%5Ct%5C%22visibility%5C%22:%20%5C%22public%5C%22%5Cn%7D;%5Cn%5Cn//%20create%20and%20post%20HTTP%20request%5Cnvar%20http%20=%20HTTP.create();%5Cn%5Cnvar%20response%20=%20http.request(%7B%5Cn%5Ct%5C%22url%5C%22:%20endpoint,%5Cn%5Ct%5C%22method%5C%22:%20%5C%22POST%5C%22,%5Cn%5Ct%5C%22data%5C%22:%20data,%5Cn%5Ct%5C%22headers%5C%22:%20%7B%5Cn%5Ct%5Ct%5C%22Authorization%5C%22%20:%20%5C%22Bearer%20%5C%22%20+%20token,%5Cn%5Ct%5Ct%5C%22idempotency_key%5C%22%20:%20id_key%5Cn%5Ct%7D%5Cn%7D);%5Cn%5Cnif%20(response.statusCode%20==%20200)%20%7B%5Cn%5Ctconsole.log(%5C%22Posted%20to%20Mastodon,%20ID:%20%5C%22%20+%20response.responseData.id);%5Cn%7D%5Cnelse%20%7B%5Cn%5Ctconsole.log(%5C%22Mastodon%20Error:%20%5C%22%20+%20response.error);%5Cn%5Ctcontext.fail();%5Cn%7D%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22D209F090-AD61-4BF1-B602-FE00E8485920%22%7D%5D,%22shouldConfirm%22:false%7D)
Spring Selection
https://actions.getdrafts.com/a/2ES

Send selected text to Spring for Twitter (https://apps.apple.com/us/app/spring-for-twitter/id1508706541)’s compose window via URL scheme (https://github.com/softwarehistorysociety/Spring-for-Twitter/blob/main/URL%20Schemes.md). If no text is selected, the entire draft contents will be passed.
Posted by David BlueInstall (drafts5://action?identifier=2ES&data=%7B%22notificationType%22:2,%22disposition%22:0,%22assignTags%22:%5B%5D,%22icon%22:%22season-spring%22,%22groupDisposition%22:0,%22uuid%22:%222A77BD16-9C4D-4228-BB74-7BEAE04C40A3%22,%22visibility%22:480,%22name%22:%22Spring%20Selection%22,%22groupUUID%22:%22BE46B905-851A-49C0-9933-56DC16326F05%22,%22tintColor%22:%22indigo%22,%22backingPlatforms%22:3,%22keyCommand%22:%7B%22optionKey%22:true,%22input%22:%22P%22,%22controlKey%22:false,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Spring%20Selection%22,%22shiftKey%22:false%7D,%22keyUseIcon%22:false,%22backingIsSeparator%22:false,%22shortName%22:%22%22,%22backingActionType%22:%22action%22,%22actionDescription%22:%22Send%20selected%20text%20to%20Spring%20for%20Twitter)
created by @FlohGro (https://twitter.com/FlohGro) / more on my Blog (http://www.flohgro.com/blog)

Add to Obsidian Note

This action adds the content of the current draft to a selectable note in your Obsidian vault.

You can configure the notes which should be the options in the prompt very easily.

Follow the instructions to configure the action before you use it.

[Configuration]

Before you can use the action you need to configure it depending on your setup in Obsidian and personal preference.

The configuration parameters are adapted in the „Define Template Tag“ steps in the Action. To change the configurations edit them to match your setup - don’t change the names of the template tags since the action won’t work anymore afterwards. The following parameters must be adapted:


obsidianVaultBookmarkName: the name of the folder bookmark that will be created to access the files in your vault (see the Drafts documentation for more information about Folder Bookmarks (https://docs.getdrafts.com/docs/settings/bookmarks)). When you run the Action the first time it should prompt you to select a folder for that bookmark. Default: Obsidian Vault
configurationDraftTitle: the title of the Draft which is used to configure the Notes for this Action (see further details below) - this is just the title of the Draft which the Action will search for. Make sure this is unique if you need to change it. Default: Add to Obsidian Note Action Configuration
textAddMode: you can choose if the action should prepend or append the draft to the daily note - only prepend or append are allowed. Default: append
textAddPrefix: an optional prefix that will be prepended to the content of the Draft. Default: empty


The first time you run the action, it will create a new draft titled Add to Obsidian Note Action Configuration (Default setting). Think of this draft as the engine or library behind the Drafts Action. (You can tag and archive this draft in the Drafts after configuration to hide it in your day to day work.)

Now you can configure to which Obsidian Note this Action can add content to:


Open your Obsidian Vault and search the note you want to add content to
open the command palette and search for Copy file path - run that command
Navigate back to the Add to Obsidian Note Action Configuration Draft and paste the copied file path as new bullet point
Remove the „.md“ at the end of the line


IMPORTANT: If you‘re running the Action the first time after you configured it and it shows an error that the file is not existing even when the file exists in Obsidian then please go into the Settings of Drafts, navigate to „Bookmarks“ and make sure that the configured bookmark name is not set to „-unknown-“. If it is set to Unknown then tap „Select Folder“ and navigate to your Obsidian Vault in the files UI, select it and tap „Done“ in the upper right corner.

Here is a small example to illustrate how a configuration Draft could look like:

# Add to Obsidian Note Action Configuration

- lists/movies to watch
- lists/books to read
- Drafts Action Ideas
- Gratitude
- 2 areas/FlohGro/Appreciations


ADDITIONAL NOTES

You might have different use cases like adding tasks, bullet points, text only,… to different notes or even different vaults.

You can of course duplicate this Action in Drafts and configure it differently for those use-cases.

If you want to use different vaults then in the duplicate you must change the configuration parameter obsidianVaultBookmarkName and create another bookmark for that vault in drafts. You might also want to have different Configuration Drafts for the related notes. Therefore change the parameter configurationDraftTitle to a different title (please ensure you change the name to something unique in both actions; if you only append a „2“ to the title this will not work for the original action if you don‘t add a „1“ there). I suggest to use titles you can easily distinguish like adding the vault name.
If you e.g. want to add tasks or just bullet points to the same configured notes then you can just duplicate the Action and change the textAddPrefix depending on your preferences.

If you struggle with more complex setups then just reach out to me in the Drafts forum or on Twitter

[Usage]

The action directly accesses the files so Obsidian won’t be opened when adding something to the configured notes.

Simply run the the Action to add the content of the current draft to a note of your choice. A prompt will appear with all the paths to the notes you configured. Select the note where you want to add the content to. The Action will then add (append/prepend) the content with the configured textAddPrefix as prefix.

This action supports you for many different use cases. You can e.g. append / prepend notes and thoughts to a list of gift ideas, a list of places you want to visit or a list of things you are grateful for. You can also create a note in Obsidian for regular meetings you have and add things you want to mention in the meetings to this document by using this action.



If you find this useful and want to support me you can