This prompts the user to open a folder we want to work with. Eventually I want to open each file in that folder, but only if it's a specific file type. It also needs to skip files other than our desired file type and if there's subfolders in that folder.
Note that you should generally never open a folder with the Default Application, always open it with the Finder - it is possible for the system to decide some random application “owns” folders. Same for “.app”s, always open them with the Finder (or use the Activate a Specific Application action).
Thanks Peter for the response and helping me with outlining a solution.
I've written this attached Macro that successfully filters out files like *.txt, and it also "bypasses" subfolders (which is great in my case). zzz Open Specific types of Files in Finder, only.kmmacros (6.7 KB)
However, I'm finding it hard to validate aliases. It seems like aliases don't have definite extensions, or I might be missing how to implement this?
tell application "Finder"
set theSel to the selection
set theItem to item 1 of theSel
set classItem to (class of theItem) as text
end tell
return classItem
I'm having a problem with that KM Action.
When I select an alias file using the select button on the Action, and pick an alias file, it returns the target file, not the alias file.
It's not really a bug, it is by design - when you select an alias, it is generally resolved. You have to actually work quite hard to not resolve the alias when using it.
Since we now now that this returns the original file, I would like to just check that the original file that's linked from the alias, is also of a certain extension type.
Can i use this Get Content to save as a variable?