You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Furthermore, I use a quite different approach for "Do Line/Selection". The reason is that I did not want Stata to change the working directory (which it does if you "tell application ... to open POSIX file ..."). Also, I prefer to use a fixed tempfile because this enables me to run code over and over from Stata by just pressing pageup+enter over and over which is useful to me in some developing contexts. (And also prevents that accidentally undeleted tempfiles will lie about in the system.) (In addition, I added translation from UTF-8, my TextMate default, to macroman, which is expected by Stata.)
STATA_DIR="$HOME/Library/Application Support/Stata"
TMMPFILE="$STATA_DIR/tm-stata0.do"
TMPFILE="$STATA_DIR/tm-stata.do"
if [[ -n "$TM_SELECTED_TEXT" ]]
then echo "$TM_SELECTED_TEXT" > "$TMMPFILE"
else echo "$TM_CURRENT_LINE" > "$TMMPFILE"
fi
iconv -f UTF-8 -t MACROMAN "$TMMPFILE" > "$TMPFILE"
rm "$TMMPFILE"
osascript <<-APPLESCRIPT
local oldClipBoard
set oldClipBoard to the clipboard
set the clipboard to "do \"$TMPFILE\""
try
tell application "System Events"
tell application id "com.stata.stata11" to activate
keystroke "4" using command down
keystroke "v" using command down
delay 0.2
keystroke return
end tell
end try
delay 0.2
set the clipboard to oldClipBoard
APPLESCRIPT
Ben's workflow is obviously different from mine, though no less legitimate, and there might be others too. I think the first step here is to define what the basic differences are across the different workflows, and then see if we can construct a user-configurable preference for each. Note that Stata's default behavior (i.e., for it's do-file editor) should be easily obtainable through these settings (perhaps even the default), to facilitate moving back-and-forth between the two.
The text was updated successfully, but these errors were encountered:
On May 25, 2011, at 4:39 PM, Ben Jann wrote:
Ben's workflow is obviously different from mine, though no less legitimate, and there might be others too. I think the first step here is to define what the basic differences are across the different workflows, and then see if we can construct a user-configurable preference for each. Note that Stata's default behavior (i.e., for it's do-file editor) should be easily obtainable through these settings (perhaps even the default), to facilitate moving back-and-forth between the two.
The text was updated successfully, but these errors were encountered: