1

I am trying to run a do file in Atom (macOS). The script package detects the language correctly but is "unable to run".

Atom is started from the terminal, script works for other languages and Stata is on PATH.

Any idea what might be going wrong?

1
  • Add up on the Atomist's comment. In the grammars.coffee file (MAC Path: /home/.atom/packages/script/lib/grammars.coffee) I changed Stata related part as follows: Stata: "Selection Based": command: "/Applications/Stata/Stata.app/Contents/MacOS/Stata" args: (context) -> [context.getCode()] "File Based": command: "/Applications/Stata/Stata.app/Contents/MacOS/Stata" args: (context) -> [context.filepath] Now it works, but my problem is that whenever I execute my code using cmd+i, a new Stata windows pops up. I don't know how to make it run in the existing Stata window. Hope someone can solve this.
    – Kwon
    May 14, 2017 at 6:34

3 Answers 3

2

Just to note, the issue can also be solved on Windows by editing grammars.coffee as well, the default path being C:/Users/*username*/.atom/packages/script/lib/ and changing "stata" to the location of Stata on the machine. Highlighted text also doesn't work, as each line is executed in Stata with quotes around it, meaning Stata will interpret it as a single command name, not as a command with arguments.

0

Figured it out: .

The code of the script package needs to be modified. In the grammars.coffee file, I replaced both commands of Stata by "/Applications/Stata/StataSE.app/Contents/MacOS/StataSE". Works fine now.

Adding Stata to the path variable is not sufficient (might not be necessary even).

0

This works for me too — but I use StataMP so updated the filepath as such to /Applications/Stata/StataMP.app/Contents/MacOS/StataMP and things are working fine now.

That said, I'm not sure if script supports this, but when executing a highlighted selection of code in a .do file crashes my StataMP 14.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.