Hi, I want to Hide a certain file type as soon as they are created. The file type in question is .asd files.
I had this all configured with Automator, Apple Scripts and Folder Actions, however I’m running into a few bugs and wonder if anyone can suggest better ways of doing it.
Here’s what I currently have.
I think a way round this would be to make an Apple Script to add Folder Actions to all sub-directories. It would be a one off script that I’d have to run, Unless I can get it automated somehow.
You can easily loop through subfolders/-files with a recursive handler.
on run
set s to choose file with prompt "Choose the script file"
set f to choose folder "Choose the top level directory"
addActionToFolderAndSubfolders(f, s)
end run
on addActionToFolderAndSubfolders(startFolder, scriptPath)
-- code for adding the folder item
tell application "System Events" to attach action to startFolder using scriptPath
tell application "Finder" to set allFolders to every folder of startFolder
repeat with i in allFolders
addActionToFolderAndSubfolders((i as alias), scriptPath)
end repeat
end addActionToFolderAndSubfolders