experts. what I want is like this: I create a folder named RootDir, then I double click the folder in Finder , I hope I can intercept the action and trigger specific action such as mounting this RootDir to another folder named MountDir and then open MountDir, not RootDir.

How should I do it (Using objective-c)? my platform is mountain lion (osx10.8) and I've tried using fsevent to monitor, but i don't think i can catch the action of folder open/close.... And is it the only way for me to use Finder injection to achieve this function? any suggestions would be appreciated.

有帮助吗?

解决方案

You can associate AppleScript scripts with folders. Take a look at Folder Actions Reference

A Folder Action script is executed when the folder to which it is attached is opened or closed, moved or resized, or has items added or removed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top