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

Re: [MacPerl] Text editors?



"Christopher C. Stone" wrote:
> 
> At 12/11/00 17:21 -0800, Richard Cook wrought:
> 
> > When I set mac perl's editor to TexEdit+
> > <http://www.nearside.com/trans-tex/>, I can edit the current script by
> > typing com-shift-e, which simply opens a copy in TE+. What I'd like is a
> > direct way to either switch back to perl to run the modified script, or
> > even better, actually run the script from within TE+.
<snip>
> 
> Tex-Edit is eminently scriptable, and you can to do something like this:
> 
>  tell application "MacPerl"
>     activate
>     tell front Window
>        set contents to (contents of Application "Tex-Edit"'s front document)
>     end tell
>  end tell
> 
> Put a script containing something similar to this 
> in the TE Scripts folder and end the name with:
> 
> "//E"
> (Command-Shift-E)
> 
> This gives you continuity of keystrokes between the two apps.  
> I believe you have to quit/restart TE before it will update it's script menu.
> 
> Running the script activates MacPERL and updates the contents 
> of the front window.  You can then check the syntax and/or run the script by hand.

<snip>

Thanks,
The script I'm using is similar to yours, with "Tex-Edit Plus" as the
App name:
###
tell application "MacPerl"
	activate
	tell front Window
		set contents to (contents of Application "Tex-Edit Plus"'s front document)
	end tell
end tell
###
And putting this into TE+'s "Scripts" folder, it shows up immediately in
the script menu, no need to relaunch. Runs quite smoothly and quickly.
Can toggle back and forth between mac perl and TE+. It's a beautiful thing.

Yes, really, thanks :-)

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org