Bookmark and Share

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

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

Re: st: do file script from text wrangler

From   Phil Schumm <[email protected]>
To   [email protected]
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): 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:

osascript -e "tell application \"Stata\"
open POSIX file \"\"
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, and type in either

    get id of application "Stata"


    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:

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