NICE~
yeah, yes, working now that I turned off "Failure Aborts Macro"!
Next =)
Can I get all files to show that are in sub-folders of the 'Parent' folder?
Or do all the files need to be at the top level of "Local__ParentFolderPath"?
Not really a big deal, I could move all the files into a single folder if that's the easiest way.
NOTE:
I tried to get it to show a 'Smart Folder' contents and it didn't, no biggie, just reporting.
Seems the best way would be to put all the files in a single folder.
Consider that a troubleshooting step -- @noisneil's put that sub in for a reason, so I suggest you start at the top of the thread and download all the relevant bits of this prompt system so it works as intended. If nothing else you'll then be on the same page as everyone else for future troubleshooting and feature requests.
Hey Troy itβs me again β¦ if you distinguish between files and folders in your loop you could leave your filesystem as is and solve it with nested loops
It's working great, I moved all files to a single folder, it displays correctly.
How do I filter out ' conversation ' from the display name and have it still open the file?
All the files start with ' conversation ' so it would be great to display the filename without that at the beginning.
cheers, really
Once again, workflow has completely changed for the good! WOOF
Dang !! I totally forgot about this option β¦ 4 months of not doing any Macro dev and even nearly not doing anything on my Macs carries fruits β¦
Thanks for reminding me of that Neil !!
Troy (@troy) - if you want to solve this without navigating into subfolders this is the way to go β¦ otherwise you maybe will have to consider my solution with nested loops and separation of files and folders.
Just as a reminder for the futureβ¦
And by the way congratulations to your working Macro
As I posted below, I was able to add an option for pre-selected items, so you can just ignore the rest of this. I'm good to go. Thanks!
I haven't read through everything here, but a couple of three questions:
Can I pass in a list to show what items I'd like pre-selected? For me, this is a must-have - which doesn't make it a "must-do" for you of course.
Can I toggle the sort between the order I passed things in, and alpha, and back again, while the prompt is running? Not a must-have, by any means.
If not that, how about the ability to add user-defined button(s) to the bottom of the window? That way I could click on a button, it would close the window, then I could re-sort and open the window again.
Again, not a must-have.
Can I pass dividers? I'm not sure whether I would use them or not, but it's a thought I've had. I wouldn't waste too much time on this, or any time at all.
EDIT: Forget what I wrote here previously - I'm an idiot. Here's the changes tht actually work:
All I did was add a subroutine parameter called Local__PreSelected Values, then added 1 small bit of code to the html prompt. Here's what I added, with surrounding lines for context. Just look for the code between the "dwt" comments:
...
// Add the created list item to the list.
list.appendChild(li);
}
// dwt added
var somethingWasPreSelected = false;
var preSelectedValues = KeyboardMaestro.GetVariable('Local__PreSelected Values');
if (preSelectedValues) {
preSelectedValues = preSelectedValues.split(/[\n,]/);
Array.from(document.querySelectorAll('li')).forEach(item => {
if (preSelectedValues.includes(item.dataset.fullText)) {
somethingWasPreSelected = true;
selectItem(item, true);
}
});
}
// dwt end added
// Mark the first item in the list as selected.
// dwt added "if"
if (!somethingWasPreSelected)
list.firstChild.classList.add('selected');
// Add event listeners to handle input changes and keydown events.
Simple enough. especially since you did all the hard work! (Thanks again.)
I'll probably keep it the same as I like the default colours but nice to have the ability to customize
After starting many of my prompt lists on steroids and using them for a little while now...a few considerations:
When you start typing to narrow down the list the closest match isn't highlighted so I can't simply press β if I can see it lands on the one I want. I have to navigate down to what I was looking to select first. Basically, something like the functionality of the native prompt list would be ideal.
Something I've always wanted from the native prompt list is the ability to pre-highlight the first selection in the list that contains a value and skip over anything that doesn't contain a value. In many of my lists I keep empty value descriptions at the top that describe what actions would be triggered by pressing certain modifiers. Something like this:
All these lines start with a double underscore but don't actually contain a value....they're just reminders...so they never need to be selected. If I want to quickly use the first or second item that contains a value, as is frequently the case, I have to first navigate past the descriptors, which is a nuisance.
3. Lastly, I thought having an option for a default search much like the native prompt list would be welcome, but I only really use this in one list so it's not a necessity.
Note: I noticed that you switched the default font to system-ui...for some reason this still doesn't correctly display SF Symbols in the list, if that was your intention. Using SF Pro as the font works though.
I agree that this is really an edge-case, as the input will always be user-controlled. I've never found use for it, personally. I can add it in if there's more demand.
Strange, seems to work for me.
Ok, I've increased the opacity in Light Mode. You can also set custom opacity values when setting the Prompt Colour. For example:
Very nice work! I liked your solution for the prompt modifiers...it's out of the way but there if I need reminding. Not sure why the system-ui font doesn't work for me, but at least one works. And I completely understand about the default search, but I'm not anticipating much demand...no worries