[TxMt] Re: commanding an outside app

John Laudun jlaudun at mac.com
Fri Jun 29 03:32:05 UTC 2007


On Jun 24, 2007, at 07:00 , textmate-request at lists.macromates.com wrote:

> On Jun 23, 2007, at 9:01 AM, John Laudun wrote:
>
>> Now, I know I could write an AppleScript -- okay, I've never been  
>> any good with AS, but it's there -- I was just hoping that I could  
>> not and thus be able to work entirely within TextMate. All I need  
>> is a keystroke, or perhaps two, that would start and stop playback  
>> of an MP3 file. (I assume I would have to do this through  
>> QuickTime, but if there's a simpler command-line tool that could  
>> do this, that would be fine with me.) The only wrinkle I would  
>> like to add would be to be able to set an "auto-rewind" to the  
>> START or STOP command so that when playback commenced again it  
>> would start X seconds backwards from where it stopped. Setting  
>> this X in a config file of some kind would be fine with me.
>
> Okay, I created three commands which should get you started. I put  
> these in a bundle together which is attached. You'll probably want  
> to change the key bindings.
>
> ⇧F1 Start Current Movie - Plays the frontmost window in Quicktime  
> Player after rewinding it by two seconds.
> ⇧F2 Stop Current Movie - Stops all movies in Quicktime Player.
> ⇧F3 Rewind Current Movie - Rewinds the frontmost window in  
> Quicktime Player to the beginning.
>
> So just open your MP3 in Quicktime Player and away you go. BTW, I  
> figured out the scripts by looking here:

Those are brilliant and work quite well.

And, yes, I should have read up more on Applescripting Quicktime, but  
I did not know about using osascript within TextMate.

Many, many thanks!


john




More information about the textmate mailing list