At 21:18 +0000 12/13/08, [email protected] wrote: >But if you're "at a loss in AppleScript", as you say, then you're at >a disadvantage. If you don't know how to write a file in AppleScript >then you may be some distance from a solution.
Sigh. But so true. English-like is a form of poetry much like obfuscated-C. A couple of things haven't been mentioned: 1) It is possible to run a UNIX script that operates on the underlying file which will be current if the file has been saved just before the script is run. When BBEdit sees that the file has been changed behind its back it will reload the file. (There may be a preference for that which I checked long ago and forgot.) For an example see <ftp://ftp.macnauchtan.com/Software/Osmond/osprep.pl> 2) It is possible to send AppleEvents to BBEdit from a running shell script. The tool is osascript along with its cousin osacompile. Using osascript with a here document ( << redirection) you can ask BBEdit to "find" and "copy" or report selected stuff for access by the running shell script. 3) BBEdit keeps open files in a 16 bit per byte (unicode) format and uses ASCII 12 (\r) returns for all lineends. That can get in the way and experimentation may be required to figure out just what you get when extracting data via AppleScript. It's also impossible to work with text files that use both kinds of line end. (Open any recent BBEdit worksheet with TextEdit to see an example of that.) <ftp://ftp.macnauchtan.com/Software/BBEdit/> contains some examples of AppleScript inside of a shell script. which can automatically run startup scripts when a BBEdit worksheet is opened. I'm stuck with OS 10.3.9 because I remain unwilling to dump my SE/30 file server so your mileage may vary with more modern versions of BBEdit that require 10.4 or higher. And yes... AppleScript changes with the Mac OS too. <duck> have a look at gedit with its External tools add in.</duck> -- --> A fair tax is one that you pay but I don't <-- --~--~---------~--~----~------------~-------~--~----~ 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. -~----------~----~----~----~------~----~------~--~---
