Draftodon - a Drafts Action Group for Mastodon

Over the last few weeks I have been developing an Action Group to integrate Drafts with Mastodon.

The Action Group should be easy to use and allows you to post or schedule different types of statuses to Mastodon, and includes some helpers for composing posts. You can also reschedule or delete scheduled posts.

Like Draftist and the inspiration from @sylumer’s TADpole / ThoughtAsylum Drafts Library, I implemented this using a javascript file with all the underlying functions and then built the Actions from it.

You can download the Action Group from the Drafts Directory here: Draftodon Action Group

The code and all Action descriptions and instructions are hosted in the GitHub repository here: Draftodon GitHub repository

Make sure you run the Draftodon Setup/Update Action after downloading the Action Group and install the Draftodon.js file.

To start using it, all you need to do is configure your Mastodon instance and user handle in the Draftodon Settings Action, but I suggest to read through the instructions first

I hope Draftodon is a helpful tool for you and speeds up many of your workflows and processes.

Let me know what you think :slight_smile:


:mega: Spread the Word and Share Your Feedback

Hopefully this action group is useful for you. I would appreciate if you share it with your network :rocket:

If you encounter issues, have any feedback or further suggestions please let me know :speaking_head: You can open an issue in the GitHub repository, reach out to me on Mastodon (FlohGro@social.lol) or just reply in the thread here.


How to Update to a new version of Draftodon?

  1. temporarily save your settings of the “Draftodon Settings”, “insert Mastodon handle” and “insert hashtag” action in a new Draft
  2. Update your Action Group from the Action Directory
  3. run the “Draftodon Setup/Update” action and select “Setup/Update Draftodon.js” which will update the JavaScript file in your Scripts folder
  4. Reconfigure your settings in the actions mentioned above and you’re ready to go

Draftodon Version History

6 Likes

I released v. 1.1

:bug: showCharacterLimit issue fixed (the limit indicator was added multiple times)
:new: visibility added as optional parameter for publishing functions (defaults to “public”)

How to Update:

Update The ActionGroup:
Since I made changes to the Actions themselve, please update the Action Group itself.
Run the “Draftodon Setup / Update” Action and select “Update Draftodon Action Group”

If you don’t want to reconfigure the Draftodon Settings and e.g. insert Mastodon handle Actions - simply delete the new ones and move the ones from the previous version into the newly installed Action Group.

Update the JavaScript File
Run the “Draftodon Setup / Update” Action again and select “Setup / Update Draftodon.js”

You should be ready to go and use the new features :slight_smile: If you miss anything in Draftodon please let me know!

I’m not able to get this working.

I’ve gone through the installation (both in 1.0 and 1.1) and updated the variables for instance and handle and updated the .js script.

I even removed everything and started fresh.

When I try to run the “Post to Mastodon” action, I get a file save dialog

Also, when I try to “schedule draft”

I get “Action Not Found” - “The action specified by the include action step cannot be found”

I am a relatively new pro user, so are there any dependencies or steps that I may have missed?

1 Like

Hi @Greg sorry that you’ve got issues setting this up…

can you do the following steps to cleanup your installation first and then install it again with some confirmation steps:

  1. remove all Action Groups named Draftodon from Drafts (go to Manage Actions and delete all of them) - and ensure that you don’t have any Actions installed from Draftodon (e.g. use the search for “Draftodon” nothing should appear)
  2. go to iCloud Drive/Drafts/Library/Scripts and delete the file “Draftodon.js”

This should clean your installation - and hopefully its not synced back to your device.

  1. install the latest version of Draftodon from the directory: Draftodon | Drafts Directory
    and ensure that it looks like this in your Drafts Installation:

  2. run the Draftodon Setup / Update Action and select “Setup / Update Draftodon.js”

  3. go to iCloud Drive/Drafts/Library/Scripts and check if the file “Draftodon.js” exists.

now you should be able to e.g. use the “post draft” action


The “Action Not Found” issue was my bad but it should be fixed for all Actions now so this should not occur anymore.

If never seen a file save dialog (and only the Setup Action stores the Draftodon.js file in your directory, other files are not used)

let me know if going through this helped :slight_smile:

That did it. Thanks!!! It was driving me nuts and except for deleting the .js script, was what I had done in the past. You should have received an @mention from me on masto.

Glad it works now!
I have no idea what has happened to you… but sometimes software is weird :smiley:

I am using Ventura and downloaded Draftodon. I followed the instruction to run the Action “Draftodon Setup/Update” and have checked that the Draftodon.js is downloaded. But when I clicked “Draftodon Setting” Action, nothing happened. No prompt or anything. I deleted the Action group and .js file and start over and nothing happened.

I also tried in iOS as well and couldn’t configure the Mastodon instance. Any idea?

Is there some permission I need to give to run .js files?

You need to edit the Draftodon Settings action.
There you’ll find a few „define template“ steps to e.g. define your mastodon instance.

Don’t change the name of the template tags, change the content. E.g. for the mastodon instance you need to change the „UNDEFINED“ into e.g. „mastodon.social“

Running the settings action does not display anything - this action is used in many other actions to avoid having to type it into every action again

1 Like

I don’t see any mention of this in the setup instructions. Where is that explained.

Might it be better to use credentials to store this sort of data?

I wonder if you could also support multiple sets?

Everywhere I’ve seen it mentioned, it has been referred to as “Draftodon”, except for in the directory and subsequently when installed into Drafts, where its actual name shows as “Draftoton”. Is this intentional, or a typo?

2023-02-18-17.19.06@2x

added it to the instructions - thanks. Was on my list to improve anyways :slight_smile:

I use credentials to store the data but somewhere the user needs to define the instance so Drafts can authenticate and store the corresponding credential.
The mastodon instance and user handle is not sensitive :wink:

I have this on my next steps list. It should work already but that’s difficult to set up and I want to improve that.

Thanks for the typo mention :joy: I’ll try to fix that :man_facepalming:t3:

Data stored in credentials does not have to be only for sensitive information.

The other template tags in the settings are defaulted configuration for operation, but the handle & instance seem to be data for the user’s account, which are data for use in authentication, and so even fit within the general description for the intended purpose of credentials.

Credentials are service tokens and authentication information stored by Drafts for reuse.

If you included them as credential data, you could then prompt for it on first run. Switching accounts I think (I have not fully worked through the code required) should then come down to having the actions written to reference accessing a particular named set of credentials.

Just a suggestion in the hope that it might save you some future headaches.

Yes I guess you’re right @sylumer - I could just ask for the credentials when running one of the actions the first time… could really ease a few things up :+1:t3:

Thanks for the suggestion

What is Mastodon handler? I don’t think it’s just my email as there’s no where I have to key in my password nor do I see a prompt from Mastodon to allow a 3rd party app to connect. So, I’m still stuck after editing the Draftodon Settings (sorry for the trouble but I’m not understanding how to proceed)

This is from the action description of the Draftodon settings action:

Mastodon instance & handle

  • mastodon_instance: your mastodon instance e.g. mastodon.social; Default: UNDEFINED
  • mastodon_handle: your mastodon user handle on the defined instance e.g. @FlohGro for @FlohGro@mastodon.social; Default: UNDEFINED

So if you are on the instance mastodon.social and your handle there would be „belgarion“ then you would use „mastodon.social“ as mastodon_instance and „@belgarion“ as user handle.

The user handle is not that important right now it just identifies the credential that draft stores…

You will see a prompt to authenticate with mastodon when you run the first action that needs them. You can e.g. run the action „show scheduled posts“ and it will ask you to authenticate - nothing will be posted to your account with this action

Thanks. I edit and didn’t work.
I had to delete the Action Group, re-download it (and I see you put examples into the template, instead of UNDEFINED, thanks for that!!). After the re-download, it works like a charm! Thanks.

1 Like

I updated my Drafts Action Group „Draftodon“ to use Drafts with Mastodon

New in this version:

:person_juggling:t3: multiple accounts support
You can now use Draftodon with multiple Mastodon accounts! Just follow the instructions provided in the repository to set it up: Draftodon/Draftodon Instructions.md at main · FlohGro-dev/Draftodon · GitHub

Don’t have multiple accounts? you won’t notice any difference :+1:

:leftwards_arrow_with_hook: reply to status action
Do you want to write a response in Drafts because you need to think about it for a bit or just to don’t get lost in your timeline?
Simply paste the URL of the status into the first line of the draft, write your response, and run the action. It’s that easy!

and some :pinching_hand:t3: minor improvements for authentication issues

:link: Download and Installation

  • temporarily save your settings of the “Draftodon Settings” action in a draft
  • Update your Action Group (or download it the first time) from the Action Directory Draftodon | Drafts Directory
  • run the “Draftodon Setup/Update” action and select “Setup/Update Draftodon.js” which will update the JavaScript file in your Scripts folder
  • Reconfigure your settings and you’re ready to go

I’d also love to hear your feedback and suggestions for future updates. Feel free to open an issue on our GitHub repository, reach out on Mastodon or reply here i n this thread.

2 Likes

Awesome… although, the older version of Draftodon works so well for me, I am not sure I want to update it yet, since I don’t have multiple accounts. Thanks for continuing to improve it!

You don’t need to update it yet if you don’t need the reply to post action.
If you don’t have multiple accounts the new version shouldn’t make any difference, I use it mostly with just one account, too. If you only configure one account, in fact you won’t notice any difference.

But you can just wait for a release that has relevant features for you to update.

Let me know if you have something in mind.

1 Like

:loudspeaker: Draftodon v1.3 released

:new: public urls are now appended to your published drafts :link:
:new: quote post action :speech_balloon:
:pinching_hand: minor changes, documentation improvements and :bug:-fixes

:link: public urls appended to published drafts :link:

If you publish a post / thread with one of the actions of Draftodon the url of the published status will now be added at the bottom of the draft. This allows you to quickly jump to the post on your instance - either immediately after publishing it or weeks later :+1:

:speech_balloon: quote post action :speech_balloon:

If you also miss a quote feature in Mastodon (which hopefully will be added sooner than later) you can now use the “quote status” action in Draftodon.
Just copy the url of a post, paste it into the first line of a new draft and add you comment or whatever you want to add in the following lines. The quote status action will search for the linked status and add “:speech_balloon: [quoted user] [quoted status url]” to the bottom of your post :muscle:

:arrow_down: Download and Installation

:one: temporarily save your settings of the “Draftodon Settings” action in a draft
:two: Update your Action Group (or download it the first time) from the Action Directory Draftodon | Drafts Directory
:three: run the “Draftodon Setup/Update” action and select “Setup/Update Draftodon.js” which will update the JavaScript file in your Scripts folder
:four: Reconfigure your settings and you’re ready to go

:mega: Spread the Word and Share Your Feedback

Hopefully you’ll like this update. I would appreciate if you share it with your network :rocket: and if you consider to support my work: donate – FlohGro

If you have any feedback or further suggestions please let me know :speaking_head: You can open an issue on GitHub or just reach out here in the forums thread

Have a great day :sunglasses:

Mastodon Thread for the update (:rocket: appreciated)

1 Like

:mega: Draftodon v1.4 released :mega:

I just released a new version for Draftodon – my Drafts Action Group for Mastodon.

TL;DR:

:new: post from prompt action
:new: post / schedule with hashtags action
:new: import bookmarks action
:new: import favorites action
:new: import from home timeline action
:arrow_upper_right: multiple accounts can now have different character limit settings
:arrow_upper_right: insert hashtag / mention improved

:new: post from prompt action :writing_hand:

If you want to quickly post a status to mastodon just run this action. It will display a prompt and ask you for the status text. It will publish the given text and store it in a new draft.

:new: post / schedule with hashtags actions :label:

Do you use the same hashtags over and over again? Use these actions to append configurable hashtags to the current draft and publishes / schedules it afterwards. Duplicate them for use with different hashtags.

:new: import bookmarks action :books:

It‘s great that you can bookmark statuses on Mastodon but do you really review them? This action fetches your bookmarks and presents them in a preview. From there you can choose to import one which will create a new draft with the content, some meta information and a link back to the original post

:new: import favorites action :star:

Similar to the import bookmarks action you might want to import recently favorited status? Now you can!

:new: import from home timeline action

Last but not least you can also import a recent status from your home timeline? You don‘t even need to import one you can just view them using this action without getting sucked into a rabbit hole.

:arrow_upper_right: multiple accounts can now have different character limit settings

In previous versions the character limit was a global setting and you couldn’t set different limits for different accounts. Now you can!

:arrow_upper_right: insert hashtag / insert mention improved

These two actions will now activate the editor after the insertion point to stop interrupting your writing flow


If you like this update I‘d appreciate if you share it with others by boosting the post on mastodon:

1 Like