

This is less of an issue than a bonus I wanted to flag for your attention. One workaround is to define the directory name of the project to a variable such as project_directory and write out the desired output location as project_directory/graphs/.Īdditionally, is there a reason that the sublime2stata.do file isn't deleted after executing the script? If it worsens performance, it's probably not worth fixing, but if it's just adding a line of code, that would probably be best.Ĭreated 20 Nov, 2017 Issue #55 User Nreith However, since the do file causes STATA's working directory to move to project_name/code/, my relative reference to where I want to save the graph is incorrect. Ordinarily, I would navigate to project name and then export the graph to graphs/graph_name.png. For instance, I execute code from a do file in /project_name/code/ folder, but like to save graphs to /project_name/graphs. This is undesirable because many do files make use of relative references. Whenever you send files to stata, it changes the working directory of STATA to the working directory of the do file you executed. Please take this criticism as a compliment and feeling of indebtedness to provide feedback. This extension is so wonderful that I feel bad giving any criticism. It would be cool to use those instead of temporary files (like how the OS X version of the plugin uses temporary files for Stata 11–12, but the API for 13).Ĭreated 19 Mar, 2014 Issue #11 User Danachandler

Change this in Do-file Editor > Edit > Preferences > Advanced > Edit do-files opened from Windows instead of executing them (uncheck this) In order for it to work correctly on your system, you must ensure thatįiles opened in Stata are run, not edited. This package sends selected code to a temporary file and then opens that file in Stata. Stata Enhanced (Windows).sublime-settings

) Set the full path of your Stata installation (with slashes reversed) in If you prefer for Stata to take focus after sending lines or selections, set the Change this in Preferences > Do-file Editor > Advanced > Edit do-files opened from the Finder in Do-file Editor (uncheck this)īy default, when sending code to Stata on OS X, Sublime Text will maintain focus so you can continue to edit, following the pattern of RStudio, which sends code to the R console from the script editor without changing focus away from the editor. Because of scripting limitations in Stata "Get Info" > "Open with" > "Change all…" > Select Stata.įiles opened in Stata need to be run, not edited. ) Send current line or selection to Stata:

This package adds basic support for Stata (11–15, Windows and OS X) and comes with:Ĭommands for sending individual lines or selections to Stata (available via the command palette and with keyboard shortcuts):
