1

There are several different ways documented of setting environment variables either system wide or per user, see this question.

Are there any options for setting environment variables on a per-application basis?

E.g. Is there a way to use something like ~/.MacOSX/environment.plist or launchd.conf but have some variables only inherited by specific apps?

The only way I can think of is to modify each applications Info.plist, but this involves changing an applications bundle which doesn't seem like a terribly good idea.

Community
  • 1
  • 1
snowcrash09
  • 4,694
  • 27
  • 45

1 Answers1

4

Typically this is done by wrapping the desired app in a small shell script or automator action that sets the environment variable and then launches the app. For example, I have an automator "application" that has the following rule:

Run Shell Script:
  NSZombiesEnabled=YES open /Applications/MyApp.app

When I want to launch it this way, I just run the automator action.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610