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.
showCharacterLimit issue fixed (the limit indicator was added multiple times)
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.
Run the “Draftodon Setup / Update” Action again and select “Setup / Update Draftodon.js”
You should be ready to go and use the new features If you miss anything in Draftodon please let me know!
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:
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)
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.
install the latest version of Draftodon from the directory: Draftoton | Drafts Directory
and ensure that it looks like this in your Drafts Installation:
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?
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?
added it to the instructions - thanks. Was on my list to improve anyways
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
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.
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.
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.
Don’t have multiple accounts? you won’t notice any difference
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 minor improvements for authentication issues
Download and Installation
temporarily save your settings of the “Draftodon Settings” action in a draft