On Tue, 9 Mar 2010 16:05:04 -0800 (PST), Kendall Conrad <[email protected]> wrote: > I know how to use AppleScript with BBEdit to move the cursor, replace > content, etc., but can other scripting languages do this as well, such > as Python? I've looked around some, but haven't found anything. I know > about the Run menu and being able to run Python scripts from BBEdit, > but haven't found a way to let Python tell BBEdit to do things like > move the text cursor and replace content at a certain spot.
AppScript http://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.
