Can BTT launch an app by opening a finder folder?

Hi,
Is it possible to launch a specific app when I open a specific finder folder?
Thanks

You can create a apple script like this:

on opening folder theFolder
	tell application "BetterTouchTool"
		trigger_named "test"
	end tell
end opening folder

And save it to this folder: ~/Library/Scripts/Folder Action Scripts

Then you control click on the folder you want to configure and choose services => Folder Actions Setup. Then you select the script.

This will then trigger the named trigger "test" in BTT. (Configure that in the "named & other triggers" section in BTT). Of course you can also directly use folder actions to launch an application using Apple Script, then you'd use a script like this:

on opening folder theFolder
	tell application "iTunes"
           activate
       end tell
end opening folder

More info on folder actions: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WatchFolders.html

1 Like

Awesome, that is what I was looking for.
I'm a Mac user since Mac OS Tiger, and back then, the option of folder actions was already there, but I never really understand what it was for and how it worked. But now I'm a bit smarter. :grin:
Thanks :pray:

Imprint | Privacy Policy