Draftodon - a Drafts Action Group for Mastodon

Hello, I’ve been trying to get Draftodon working.

I’ve deleted the credentials from Drafts. Now I get this error.

CleanShot 2023-12-10 - CleanShot - CleanShot

I’ve been using the Draftodon Setup / Update action. Then edited the settings accordingly.

I’ve also tried reinstalling from the Drafts Directory.

Could you help me out?

You haven’t confirmed in the post above, so can you check you can login to Mastodon on the web using the credentials you have been trying?

Can you share the settings for your mastodon instance and your mastodon handle?

Yes. I can log in to the mastodon instance via Safari.

mastodon_instance = mstdn.social
mastodon_handle = @haphazard

Thanks for both confirmations.

I just deleted my credentials from Drafts to test the behavior again.

I logged into my mastodon account on the instance I use in safari
Then I ran the action „import bookmark“ in Drafts
After continuing the prompt for the authentication, safari opened and immediately asked me to open Drafts again

The authorization was successful and I didn’t need to type any password.

Can you confirm that this is not working for you (logging into safari first, then running the action (make sure there are no typos in the instance and username)

I get 2 errors now. The first one is:

Alert
Request Failed because Drafts was not authorized properly:
Please go into Drafts settings and navigate to “Credentials”, search for “Mastodon”
@[[mastodon_handle]]" and tap on “Forget” - then try posting again and it should authenticate you properly

Now I get this error:

CleanShot 2023-12-10 - CleanShot - CleanShot

Mastodon doesn’t appear in the Credentials Settings either.

If mastodon doesn’t appear in your credentials settings then it wasn’t authorized properly - the error message you typed indicates this, too.

The error from your last screenshot is a result from the first failure - I should prevent that in the script but that won’t fix your issue.

Is this the first time you’re using Draftodon? Do you use any third party clients with your mastodon account?

It is the first time I’m using Draftodon. I use Mona as my main third party client and I haven’t had any issues with it yet.

ok thanks.

I created a test account on mstdn.social to check if i can get it to work with that instance.
Its working for me.

can you do the following steps and share your observations afterwards:

  1. delete the credentials for mastodon in the Drafts app (Should be named Mastodon @haphazard in your case)
  2. make sure to log out on mstdn.social in Safari
  3. ensure that no typos are in the template tags for mastodon_instance and mastodon_handle in the Draftodon Settings action
  4. run an Action from Draftodon Action Group that has to authenticate with your instance (e.g. post status from promt → then type your post into the prompt e.g. "Posting with #Draftodon)
  5. Drafts should now ask you to authenticate for the account → tap continue
  6. Safari should open at the login page for your instance mstdn.social → login with e-mail and password
  7. you should now see an interface where you cann authorize or deny Drafts to access your mstdn.social account → click on “Authorize”
  8. Safari will display a prompt that it wants to open Drafts → tap open
  9. Drafts should open and the action should succeed (e.g. the post you typed into the prompt will be published to your account)
  10. check if the status was published successfully

let me know if any of the steps fail or you see something different. You can make screenshots of potential error messages so I can have a look.

It could also be the result of some settings in your mstdn.social account not 100% sure if there are privacy settings that you could have enabled which deny access for apps like Drafts. Given the fact that you’re using Mona seems that this is not the case but lets try those steps above first and move on from there…

I’ve done what you said. Step 5 never happens. Drafts doesn’t ask me to authenticate my account.

I’ve deleted the credentials from Drafts app:

When I run the post status from prompt I get the same error (“App creation failed”)

And a notification in red that says “publishing text failed, try again”.

Are you able to use any of the standard Mastodon example actions from the integration guide? Before trying Draftodon, I would start and make sure those work properly for you.

It seems most like with that error you are getting, you do not have the mastodon_instance @FlohGro mentions in step 3 configured correctly, however. What do you have setup in that configuration information for his action group?

I am able to use the “Post to Mastodon” example action from the integration guide. The mastodon instance opened correctly and asked for authorization and I was able to post to Mastodon. Mastodon now appears in the credentials pane of the Drafts app.

But Draftodon keeps getting the same error.

Here is my Draftodon Settings

I can’t use the “Post to Mastodon (Script)” by the way.

It appears you editing the name of the template tags, not the template value.

Start by reinstalling Draftodon from the directory to get a fresh copy. Then to configure it’s values, do not change the “Name” fields, but the template fields where the default values are “UNDEFINED” in the fresh install.

That worked!

Thanks a lot!

1 Like

Thanks for jumping in and helping out!

Great that this got resolved.
I was planning a rewrite of the settings to make that easier and don’t use the template tags - this caused confusion a few times now.

I could mention it more explicitly that I a user shouldn’t change the template tag names…

Just as a quick fix, you might use “CHANGE ME!!!” instead of “UNDEFINED” as a default value.

2 Likes