Thanks so much Maarten! I'm using it now.

I had to install the mate command as described here
http://manual.macromates.com/en/using_textmate_from_terminal.html

and unwrap some of the comment lines in your script to make the
compiler happy, but other than that it was really easy. once i added
Lee's fix for line number and it works like magic.

Thanks again!

Nevan

On Sep 30, 12:47 am, Maarten Sneep <[EMAIL PROTECTED]> wrote:
> On 25 sep 2008, at 10:36, Nevan King wrote:
>
> > Is there a quick way to quickly switch editing a file between BBEdit
> > and Textmate? For example, if I'm editing a file in BBEdit and I want
> > to open the same file in Textmate, usually I'll drag the icon from the
> > menubar onto the Textmate icon, then save when I finish and go back to
> > BBEdit. I'd find this easier if I could set up a shortcut key (even
> > better if I could do it in both BBEdit and Textmate). The way you can
> > switch editing between Photoshop and Illustrator is a good example.
>
> This AppleScript will switch from BBEdit to TextMate:
>
> (* Script to switch a document from BBEdit to TextMate.
> Written by Maarten Sneep, 2008. Enjoy *)
>
> tell application "BBEdit"
>         -- save the active document
>         if (modified of active document of window 1) then
>                 save active document of window 1
>         end if
>         -- get path of active document
>         set mypath to get file of active document of window 1
>         -- get line number of insertion point
>         set theSelection to selection
>         set theline to (startLine of selection)
>         -- Hope that 'mate' is installed in a location that is in the  
> standard path.
>         -- if sh complains, use full path here.
>         -- assumes mate can be called with a +linenumber argument to set the  
> active line.
>         do shell script "mate +" & (theline as string) & " " & quoted form of 
>  
> (POSIX path of mypath)
> end tell
>
> -- end script
>
> Copy and paste the script text in the Script Editor, and save the  
> compiled script in ~/Library/Application Support/BBEdit/Scripts//.  
> Keyboard shortcuts can be added from the Scripts Palette in the  
> Windows menu.
>
> I don't know anything about scripting TextMate, you'll have to ask  
> elsewhere. The shell command "bbedit +linenumber file" is available.  
> Hope this helps.
>
> Maarten

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[EMAIL PROTECTED]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to