I want to be able to run a graphical program from the command line, so I add a symlink to the program (/Applications/Stata/Stata.app/Contents/MacOS/Stata) from /usr/local/kkjj/bin/xstata. When I run xstata, I get an uncaught NS.

Here's the whole output to stderr: http://pastebin.com/RsvJrcPr

Is there any other way to deal with this than with an alias?

  • Can you explain the problem with an alias? – Andrew Lazarus Aug 20 '14 at 1:05
  • The problem with the alias is that I want to have an alias that runs another command with Stata as an argument. I guess recursive aliases work, though, so I'll try that. – katriel Aug 20 '14 at 20:23

This Error indicates that the Application can't find its InterfaceBilder (NIB) File (the GUI Part of the App). Probably caused by the Fact that the App has stored the relative Path to its NIB.

When you use double Click to open or the whole path to the App as Terminal command it works (correct directory) but not with your symlink (which is stored at another location -> relative path is changed)

There are three Solutions how you can run the App from Terminal without a symlink.

  1. Create an alias in your ~/.profile which points to the App (absolute path).

  2. Use the command open open -a <Application Name>

  3. Create a shell script named like the App which launches the App with the open Command (like 1.) or the absolute path (like 2.)

hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .