Matt - thanks, very helpful. I know I’m on the right track, but still not there yet, and embarrassed that I still have another question. I’m using
draft.setTemplateTag("folderTag",selectedItems);
and I’m getting the correct integer of the number of the selected item’s position in the list. (I got the same result using prompt.selectedItems.) I’m trying to use the title from the selected item as the variable. Is that possible, or do I have to create a separate switch statement, using the integer from the selectedItems variable?
Matt will be able to answer this more accurately, but to at least attempt to point you in the right direction, I’m thinking you’d be able to access the title if you set your variable as array[selectedItems] (where “array” = could be replaced with whatever the name of the array holding your folder names might be)…
As noted in this thread, selectedItems is just an array of the indexes (positions, starting at zero) of the items that were chosen. You need to then obtain the corresponding actual item from whatever data you initially put into the prompt. For example, if you had an array of paths and used an MGCheckListPrompt to pick some of them, you’d then use the indexes in selectedItems to retrieve the relevant paths from the original array.
I appreciate that that’s probably a pretty opaque answer and you’re just trying to get this working! My general advice would be to read about arrays in JavaScript (I sense you haven’t done much programming?), but if you post your specific Script step then I’m sure someone will show you how to do it in this particular case.
Works on my iPad, but I see it doesn’t work on the phone. I suspect that something else might be snatching the keyboard focus. No guarantee that I can fix that, but I’ll fiddle with it when I have some time.
I really do need the actual HTML. I already suspect I know what sort of problem it is (to do with how the live filter highlighting inserts/removes HTML into list items), but I need to see what’s really happening.
Martin, I am proud to say I do understand what you’re talking about, even if I do not yet understand how to do what you are talking about. For now, I used a Switch statement. It probably doubling the work, but it’s all working great. Thanks!
Matt: I know I’ve said it before, but there’s a warm place in my heart for this prompt/library. If pushed to recommend an action that has most deeply transformed my use of Drafts, this would be it. That might sound a bit hyperbolic, but the foundation the prompt and library provide has powered a few of my most cherished workflows. Many, many thanks for making it.
@mattgemmell, thanks so much for sharing. The design and documentation of the MGCheckListPrompt action group are so well done! I’ve use the MGCheckListPrompt Library in an action I’ve recently shared: Add Lines to List