Move to Trash not working after Success when checked. (Mac only)

Move to Trash not working after Success when checked. (Mac only)

It this problem specific to this action? I can’t reproduce any issues here with the after success action.

What does happen when you run this?

Do you get a green success banner in Drafts?

Any message in the action log?

(Separate to the issue being reported, I’d recommend you use the Callback URL action step when working with an app that supports x-callback-url. This allows Drafts to wait to perform an after success action until the target app returns a success message to Drafts)

It happens in multiple similar actions sending to Bear app. (Mac only. iOS is fine)
It runs successfully with a green banner. Just does not move to trash.
No message in the action log
Ill look into the Callback URL.

I tried to reproduce your action exactly (it is easier if you share a link to it for testing) and it did move to the trash for me. However, there is always the chance I missed something in rebuilding the action.

Here is the action I created based on the screenshot that was posted.

If I run that against some boilerplate text in a draft…

Boilerplate Text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus eget neque nec ipsum ultrices ultricies et a tellus. Quisque molestie leo purus, vitae imperdiet orci. Pellentesque mauris turpis, eleifend at lobortis eget, lacinia vitae lectus. Praesent nec elit nunc, nec molestie nisl. Suspendisse facilisis mi vitae nisi sollicitudin ut imperdiet elit rhoncus. Etiam interdum cursus purus, ut pharetra enim adipiscing faucibus. Nulla malesuada aliquam sollicitudin. Integer imperdiet accumsan iaculis. Quisque fermentum, lorem condimentum convallis auctor, erat sapien egestas sem, et rutrum diam nunc eu mauris. Etiam quis urna et velit euismod mollis. Morbi congue orci eu purus facilisis id hendrerit dui malesuada. Nulla nisi nisl, scelerisque eu euismod faucibus, scelerisque et lectus. Maecenas consectetur tristique justo ut venenatis. Nulla facilisi.

Nullam ac magna lectus. Phasellus rhoncus tempus orci at fringilla. Nullam at pulvinar orci. Phasellus tempor, turpis ac iaculis sagittis, sem nunc elementum nunc, placerat pulvinar urna dui quis enim. Etiam sollicitudin pretium tempor. Ut cursus rhoncus odio, sed eleifend risus pretium eu. Fusce eu enim quis nisi pellentesque lacinia. Nulla faucibus blandit orci eu viverra. Donec vestibulum tempus facilisis. Ut et justo quis massa suscipit feugiat. Phasellus sagittis scelerisque tincidunt. Donec diam quam, semper eget aliquam vel, vehicula vitae erat. Morbi tortor mauris, sodales id tristique vel, feugiat vitae tortor. Etiam a elit nunc, id malesuada diam. Nam nisi mauris, luctus nec sodales vitae, mollis eu risus.

… I get the following in Bear.

There’s some non-encoding/decoding going on there which I think is down to some errors in the construction of the URL. Here is the action with some reworking to do what I think you were attempting to do.

And, here it is simplified a little using the x-callback-url action step.

The result in Bear is identical to the previous one, and for those latter two, the prepending and separator line insertion works fine. Here two parts of a nursery rhyme were added in sequence, but were prepended to the note in Bear, so the reading order is reversed, and the separator line divides them into sub-sections.

These actions are all trashing the draft as expected for me, including the one based on your screenshot. It would be worth you trying each of the actions I have lined above and seeing if they work for you. It might give us a clue as to how broad this issue is in relation to your setup.

If it does not occur with these, then please post a link to your original screenshotted action (or another action that has this issue - you noted you have numerous affected ones). We can then test if the behaviour is occurring beyond your installation.

Hope that helps.

Thank you so much for this… Your Callback version is working for me (trashed after success) the Revised is not. I can share some of the others that where not working.

Here is another one that does not Trash after Success:

bear://x-callback-url/add-text?text=[[date|%d]]%20**%3D%3D[[time|%I:%M%p]]%3D%3D**%20~%20[[draft]]&title={{Food: [[date|%Y/%m]]}}&tags=food/[[date|%Y/%m]]&mode=prepend&exclude_trashed=yes&x-success=drafts5:

Are you sure the action is succeeding? What is in your action log?

I just pasted that example in an action with a Open URL step, and configured to trash the draft, and it worked like a charm - with the attached in my action log. Here is that action.

If you are not seeing that happen, you should provide details on Drafts/OS version, and share the exact action as you have it configured.

Yes. They all do say “Draft moved to trash” But the text remains in the draft.
I am using 42.0
The last ‘~Time~Log~x-callback’ that sylumer made seemed to fix that one.

“Text remains in the draft”?

The text should remain in the draft.

The expected behavior here, and what I am seeing on multiple Macs with the action as I provided it:

  1. Load or create a draft with some text in the editor.
  2. Open action list and run the action
  3. Bear is opened and text appended to note
  4. Draft loaded in the editor is moved to the trash
  5. A new draft is loaded in the editor.

You seem to be saying 4 & 5 are not happening for you? The draft just remains loaded in the editor? You should still be able to find the “trashed” draft in the trash bin in the draft list. It still exists, just in a different place.

I believe you are saying this all works fine on iOS with the same action?

Please clarify if there is something different about how you are running this action, or how it is configured.

  • Correct. (4&5) After completion the text remains. It is not trashed and does not move to the trash folder.
  • Everything works just fine on iOS. (Draft is trashed after success)
  • I can’t see how these actions are any different than other actions. (I also do not understand how any of this works)

When you run one that succeeds in Drafts, but is not working as you would expect, can you press and hold the new draft button and then tap info?

Then screenshot the draft info and post it here? It will look roughly something like this.

That may give us more clues as to what you are experiencing.


Everything there seems to match up - no action errors on single run and still shows as in inbox. We also know you are on Drafts 42.0 on iOS.

Was it one of the actions I posted that you used, the one Greg posted, or an action of your own?

If the latter, please share a link to it. You can share to the directory from the action editor and leave it as unlisted, then post the link here, like we did above.

I have been using your ~Time~Log~x-callback.
But now what is happening is they will be Trashed 1 out of 3 times.

What I have ended up doing is setting the Move to Ask, after Success to make it easier to trash.
This is only on Mac. Everything works fine on iOS

Ill share two with the same issue.

1 Like

Most be some sort of timing issue going on. I’m surprised we haven’t been able to reproduce. Are you running these actions by double-clicking them in the action list to the right?

Yes. Double-clicking.