Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: st: Adjusting file associations so do-files open in editor?

From   Jeph Herrin <>
Subject   Re: AW: st: Adjusting file associations so do-files open in editor?
Date   Thu, 25 Mar 2010 10:24:34 -0400


Not sure if Finder allows this, but in XP and Win 7 I can open
all my Stata files with a "wrapper" do file, so that eg "Open" on
the context menu invokes (where %1 represents the filename):

   stataSE-64.exe do "" %1

The filename is passed via %1 as an argument to; my file does all the usual stuff that should
do, and then parses the filename, taking various actions depending
on whether the extension is .dta, .do, .ado, etc. Eg, if the extension
is ".dta", gets the file size and allocates memory

	d using "`1'", short
	local size = int(r(width)*r(N)*1.5/(2^20))
	local size = max(10,`size')
	set mem `size'm
	use "`1'"

Likewise, I can associate other dofiles (there's nothing special
about the -profile- name in the above, I just use it by convention)
with the context menu item "Edit", etc, and even have different
"Edit" options on the context menu.


Kit Baum wrote:
On Mar 25, 2010, at 2:33 AM, Martin wrote:

Quite apart from the technicalities, the question remains whether users could make the "edit" action the default for a double-click. I could see a case for not having Stata execute a do-file immediately, but rather just open it...

It seems to me that a Preferences checkbox labeled "Edit do-files opened from the Finder in the Do-File Editor" does exactly that. Of course, some crippled operating systems lack a Finder...  An upgrade may be in order.

Kit Baum   |   Boston College Economics & DIW Berlin   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index