TIP: Quickly Manage Running Lists with the "Add to List" Action

Thank you for sharing this tweak! Is is possible to cut selected content after processing? Not coping I mean, or delete used text after?

This is great, and I love being able to select the text.

I wonder if someone may be able to help me.
This may be a big ask, but I was wondering if ti is possible to modify this to do a few things.

1,Is is possible to have one draft with multiple lists?
If I understand correctly the current action lets you, add a list to a draft with that title (a separate draft is created for each category, but they all share the same tag).
But is it possible to make it so that all categories are in 1 draft, under heading that are categories.
So for example, you would see Book, Movies, TV Shows, Blog Ideas all in 1 draft(note), and the check lists beneath them?
I understand the conplexities this would cause since, you have to append, or prepend under the correct heading.
I can’t code much my self, but wondering if this was doable.

2, I notice that this always creates a checkbox before the text, even if there is already a checkbox next to it.
I guess that it’s not really a big deal, since I could just remember to not make a check box, but is there a way to not create a check box if 1 has already been created?

Also I tried the “Add to list plus” action by @dchar as well.
I love the prepending, but it seems to only add a check list for the 1st item in the draft, and the rest continue as a non-check-list.
Is there a way to make this work like the original “Add to list”?

I’m very new here, and to forums in general, and apologize if my questions are “off” in any way

In general terms…

  1. Yes.

I actually have a function in my TADpoLe library that let’s you simply add content to a section by heading name for the currently loaded draft, which could make things a lot simpler.

  1. Yes.

It is just a case of checking and determining what needs to be added or removed accordingly.

If no one else takes a shot at it, I’m sure I could put something together, but it’s getting late here, so not tonight for me I’m afraid.

@sylumer
Thank you for looking into my request. I assume that to utilize the items in the link I would have to install/run all the core items and libraries right?

No rush. I know it isn’t a really big matter, as long as I remove the checkboxes beforehand, but it was just, since the way to run on selections were introduced I wanted to run the action for sections of my meeting notes which are usually already in a checklist or list.

Many many thanks

To use the function, you would need to have the library file present, and the easiest way to use and keep the library up to date is via the core ThoughtAsylum action group, which includes the TAD action which you can then just include in any other action to load in the library.

It could of course be done without utilising the library, but the whole point is to have a single source of code you can reuse and that you don’t have to design and build yourself. Why reinvent the wheel every time you want to drive?

@sylumer Understood. Thank you!

On a separate note, are there any illegal inputs for the category step of this action, for example length of the category title?
Some categories I entered, it didn’t let me append, and instead it creates a new list every time.
This isn’t the actual category, but I had a category with the name that was something like
“Learn code (Drafts - Actions)”
And it would create a new draft.

I changed the title now, and it works so it doesn’t seem to be the spaces, hyphen or brackets, and it seems to just be the length that was ultimately changed, but didn’t know if that could make a difference like this.
It works now, but wanted to know for future reference.

Thank you.

Not that I am aware of.

As long as you have something listed as a valid navigation marker, it should be okay. I don’t know what your script looks like so I cannot definitively tell you why it would create a new list.

I tried it with your example, and the function worked fine.

If you have an example that fails, then that would be useful to know because I could then reproduce the issue and figure out why it is happening.

That’s different to a new list in a draft as noted above, so I couldn’t tell if this was a different issue or not.

I’ve tried it with a 385 character title (which is pretty long), and that works just fine. I also tried it with a long title containing lots of symbols and that worked fine too.

The only thing I can think of that might cause “unexpected behaviour” would be if you had no navigation markers. Here I can see sections when a draft is displayed as Markdown and I have Markdown headings specified.

2022-07-16-17.08.11

If I switch to a syntax that does not support navigation markers, those markers will disappear from the navigation menu.

2022-07-16-17.06.12

The only flaw in this is that I can’t envisage how you would have inadvertently changed syntax when working on your section titles, so it does not seem to fit your scenario.

If there is an issue, it would be important to get the exact action, an example draft, some instructions to reproduce it, and a clear indication of what the issue is (in case my interpretation were different somehow (e.g. drafts vs lists). As it currently stands, I have spent a good thirty minutes testing cases and putting together these details, but I have not been able to produce an effect where the TA_sectionAppendByHeading() function does not work as expected. It could even come down to something in your script and what it is doing with the results of the function.

Sorry I don’t have a clear reason for the issue you encountered. I would need more data to investigate it effectively.

@sylumer You are totally right
I should have known better. Sorry about that…

Here are the details.
I have recreated this, and just checked that it actually acts oddly.
Unlisted link of the action here

I just tried this action 3 times, and here are the results

What I did

  • type random text to a new draft
  • Run action
  • Repeat x2 more times

Results

  • Created a new draft all 3 times
  • On the 3rd try it failed to delete the original draft even though the action tells it too

Here are the screen shots.
Also, thank you for going so far to even check the possibility of the syntax, but I have the preinstalled markdown as default, and all original drafts, and results say that it is markdown.

Now the only thing I have changed is the category title in the 1st step of the action

“Drafts (Actions - JavaScript)” to “Drafts _Actions-JavaScript”

And this now seems to work fine
Also, the other category in the exact same action “Apple shortcuts” seems to work fine.
This is why I started wondering if it was an illegal input(is that the correct term?) in the category title.

Does this issue seem to only happen for me?
Or had I done something wrong in naming the categories?

I thought you’d tried some things, it was a bit weird, and the it was working fine?

I’ve just downloaded and tried the action. Nothing particularly odd about the results for the Apple Shortcuts category. I realise the check boxes are doubling up, but it is just dropping in the line and prefixing a checkbox as is (not checking for an existing one).

2022-08-07-17.44.26

If I do the same on the second category, I get a new draft each time.

So, definitely down to the category name.

If you type Drafts (Actions - JavaScript) into the filter in Drafts, you’ll see it doesn’t return any matches.

If you type "Drafts (Actions - JavaScript)", you do get matches.

If you look at the advanced query options, and in particular the enforced omission option, I’m sure you’ll see why there is an issue in practice with the name.

I made a little modification to how the name is handled in the search to work around this. Give it a try.

How would one go about adding existing drafts to a list? I have a very disorganised collection, with lots of books in individual drafts, or sometimes two or three titles in one draft: how do I use Add to List to bring them all together? Most of them are tagged books

This action will work on any draft, does not matter if it’s a newly captured one, or old one. As long as you have one book per line in a draft, you can just look up those old drafts and process them with the “Add to List” action.

Excellent, thanks very much