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

Re: [MacPerl] Text editors?



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+.
___________________________________________________________________________

Hello Richard,

BBEdit (full version) has built-in MacPERL integration and most of the text-editing goodies you might want.

BBEdit 6 Product Information:
http://www.barebones.com/products/bbedit.html

BBEdit 6 Demo:
http://www.barebones.com/products/bbedit/bbedit-demo.html

I haven't started using MacPERL yet, so my knowledge of it is unsophisticated at present.  Nevertheless...

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.  I don't see a means to control this via AppleScript, but there is a "Do Script" command that would let you directly run the contents of the front TE window:

Do Script: Execute a Perl script
  Do Script string  -- Script to execute
      [extract boolean] -- if false, don't search for the #!perl line.
      [debug boolean] -- if true, start the Perl debugger.
      [taint boolean] -- if true, enable taint checks.
      [preprocess boolean] -- if true, send script through C preprocessor.
      [mode Local/Batch/Remote/Duplex] -- mode (local, batch, remote, duplex).
      [environment list of string] -- environment variables.
      [directory alias] -- working directory.
  [Result: string]  -- Result

 

Best Regards,

Christopher C. Stone 
______________________________
StoneWorks Computer Consulting
ccstone@provalue.net 

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