Thanks Doug, Jon, and Maarten.

I'll look into the AppScript, but sounds like it likely won't work if
I can't run it from inside BBEdit.

I know about osascript, and have had some luck with it, though it
doesn't always cooperate with me. I'm working on a decent size project
in Python that involves a number of files and it periodically needs to
tell BBEdit to do something, such as selecting certain text, or
replacing text at specific points in the document. It may need to
communicate with it multiple times per user-initiated runs, and that
seems to be where my scripts have more issues. When I try to use
AppleScript, it also needs to tell Python things, and I generally do
it with arguments, but can be cumbersome and error messages sometimes
get hidden, which is very frustrating.

The project is Zen Coding, which some of you probably know about
(http://code.google.com/p/zen-coding/). The latest core (v0.6) for the
script is vastly different and I have had trouble adjusting my
AppleScripts and have started from scratch. I may be looking for help
on developing it, or maybe even hand it off to someone else since I
don't have much time to work on it.

Thanks again everyone for the ideas. I'll continue to work with it and
may try to ask more specific questions if I can narrow it down, but
it's hard since I can't post all files involved.

-Kendall



On Mar 10, 7:15 am, Maarten Sneep <[email protected]> wrote:
>
> AppScripthttp://appscript.sourceforge.net/is the package to send Apple
> Events from Python or Ruby. To control BBEdit (or another Mac application),
> you'll have to generate Apple Events. Appscript is more readable than
> AppleScript, IMHO.
>
> The catch is that BBEdit does not process Apple Events while running Unix
> scripts (including Perl, Python, Ruby, Shell, Tcl, ...). That means that if
> you run a script from the BBEdit #! menu, you cannot send Apple Events to
> BBEdit from that script. This includes calling osascript to make BBEdit do
> something for you. If the script runs outside of BBEdit, this is not an
> issue.
>
> Best,
>
> Maarten

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
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 feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.

Reply via email to