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, statalist.org is already up and running.


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

Re: st: do file script from text wrangler


From   Phil Schumm <pschumm@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: do file script from text wrangler
Date   Tue, 24 May 2011 13:58:57 -0500

On May 24, 2011, at 1:36 PM, Eric Green wrote:
One thing: I can't seem to get your textmate code running. I know the Stata TM bundle posted here works (except for the local macro problem): http://bylr.net/3/2010/10/stata-bundle-for textmate/. When I replaced the existing send selection to stata code with the code you provided, nothing happens (I reloaded the bundle). I thought it might have to do with how the program is called up, but I'm really not sure.

This is the original command code to send the selection to stata:

echo "$TM_SELECTED_TEXT" > textmatetostata.do
osascript -e "tell application \"Stata\"
activate
open POSIX file \"textmatetostata.do\"
end tell"

You seem to call up stata using a different method:

tell application id "com.stata.stata11"


The first approach above is identifying the application by the application name, whereas the second is identifying the application by its so-called "bundle identifier." The latter is better in the sense that users can change an application's name (but it's much more difficult to change the bundle identifier); moreover, if you have two applications with the same name (e.g., if you kept Stata 10 after you installed Stata 11), then if you call the application by name, you can't be sure which is going to respond.

Are you using Stata 10? If so, then its bundle identifier will definitely not be "com.stata.stata11". To see what it is, open Script Editor.app, and type in either

    get id of application "Stata"

or

    get id of application StataSE"

depending on whether you have regular Stata or Stata SE installed. If you then click "Run", this will give you the bundle identifier, and you can then substitute this into the code I gave you.

Which version of OS X are you using? Depending on your answer to this, something else might be the culprit (e.g., IIRC, prior to 10.5, you couldn't refer to an application by its bundle identifier).

If you're still having problems, why don't you email me directly and I'll help you sort it out.


-- Phil

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index