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.)