![]() > !osascript -e 'tell app "StataMP" to open "%:p"' For example, one way to get Stata to open my do-file in the editor without any warning messages is to rewrite my RunIt() function as follows: > I have tried other tricks too, with help from the MacVim e-mail list. Once I get a copy of Stata 12 (hopefully within the next few weeks), I will take a look (you can do so too, by opening AppleScript Editor and using File -> Open Dictionary.). If so, this represents a change in behavior from Stata 11, and will make it impossible to execute a do-file directory from your text editor (unless Stata 12 has added to its AppleScript dictionary, or unless you want to play around with scripting via the GUI). ![]() What has me concerned is your apparent observation that sending a do-file to Stata 12 via an Open File Apple Event is opening the do-file in the do-file editor, rather than executing it. Since you are using a different OS version (Lion versus SL) and a different version of Stata, one (or both) of these are likely the cause of the differences in behavior. I don't see why this should be any different fromĪnd indeed, on my machine, it has exactly the same effect. > The blank spaces on either side of > are as shown above, if that matters. > Then Stata will start with the do-file editor open with the correct do-file loaded. Subsequent calls to do-file, after Stata is running, either in terminal or in the Vim command mode, produce the "missing value" warning but have no effect on Stata, as far as I can tell.įor me, either of these (i.e., calling do-file from the shell or from within vim) continues to work repeatedly once Stata is open, subsequent calls continue to execute the contents of the file. > The same thing happens if I edit Documents/hello.do in Vim and in command mode I type :!do-file %.Īgain, this works fine for me, although I get the "missing value" return message. I just set my text editor to silently drop this (sorry - can't tell you how to do that in vim). You get the same thing if you send a file to Stata from within AppleScript Editor. I get "missing value" on stdout, but I'm guessing that this is because the method in Stata that is responding is returning id instead of void. ![]() For me, doing what you describe above opens Stata (if not already running) and executes the file hello.do. Hmm, I can't replicate that, though I am using Stata 11 on Snow Leopard. In the terminal window, meanwhile, I get the warning "missing value". > This makes Stata 12 start up with the do-file editor open with a blank do-file that is called hello.do. Suppose I had a do-file in the Documents folder that had two lines in it: > The do-file bash script you suggested kind of works. ![]() On Aug 4, 2011, at 4:20 PM, Gabi Huiber wrote: Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at. ![]()
0 Comments
Leave a Reply. |