Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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 <[email protected]>
To   [email protected]
Subject   Re: AW: st: Adjusting file associations so do-files open in editor?
Date   Thu, 25 Mar 2010 10:24:34 -0400

FWIW -

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 "profile.do" %1

The filename is passed via %1 as an argument to profile.do; my
-profile.do- file does all the usual stuff that -profile.do- 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", -profile.do- gets the file size and allocates memory
accordingly:

	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.

cheers,
J



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   |   http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index