[TxMt] command with osascript stalls

Quinn Comendant quinn at strangecode.com
Sun Mar 26 07:18:44 UTC 2006



On Sat, 25 Mar 2006 21:29:35 -0800, Quinn Comendant wrote:

>This is either a bug or I'm doing something wrong. I've created a bundle
>command with the following line:
>
>osascript -e 'tell application "TextMate"' -e 'set bounds of window 1 to
>{640, 1, 1279, 832}' -e 'set bounds of window 2 to {1, 1, 640, 832}' -e
>'end tell';
>
>TextMate beachballs until I run 'killall osascript' in the terminal. If
>I run the above line in the terminal directly, it works as expected. Is
>there some kind of break in the chain of Command -> Shell -> Applescript
>-> TextMate?

I changed my command to redirect output to /dev/null and now it works!

osascript -e 'tell application "TextMate"' -e 'set bounds of window 1 to
{640, 1, 1279, 832}' -e 'set bounds of window 2 to {1, 1, 640, 832}' -e
'end tell'  &>/dev/null &

I'm not really sure WHY it works, but it does.

>Can anybody think of a better way to emulate BBEdit's "Arrange Windows"
>command?

This still isn't an ideal script because it is SLOW. It takes 2 seconds
for the windows to arrange themselves. I wonder if a compiled
applescript would be faster? I've never done much applescript work hmmmm...

Q




More information about the textmate mailing list