AppleScripts

BBEdit and LaTeX

These scripts are shamelessly hacked from the great Tag-o-matic from the Clankwerks scripts. They should work with older versions of BBEdit and TextWrangler, but they certainly work on my BBEdit 8/Tiger stuff.

LaTeX Tagger

This allows you to type the name of the command (the opening backslash is added by the script). If you have a selection the command encloses it, and if there is no selection the cursor is placed in the right place. I have it set to Command - Shift - L. Download it here.

LaTeX Environment

The same thing, but this creates an environment with the \begin and \end tags on their own lines. The really cool bit is that, as I use this for lists quite a lot, the clipboard automatically gets an \item tag added, so simply hitting 'paste' will add the \item tag. I have it set to Command - Option - Shift - L. Download it here.

TeXShop Preview

Lets you send the current BBEdit file straight to TeXShop. Download here.


Word > BBEdit: Simple Version

Here's a really simple little script to copy an open Word document and paste it into BBEdit. The key to it working is using Word's Visual Basic call instead of the usual AppleScript.

tell application "Microsoft Word"
	activate
	do Visual Basic "Selection.WholeStory"
	copy
end tell
tell application "BBEdit"
	activate
	make new text window
	paste
end tell

G5 Nap Disable

I use this script on the G5s at New College. They suffer from the processor idling noise, so installing the CHUD tools and turning Nap off works. It doesn't persist after shutdown though, so this script (saved as an application and placed in the Startup Items of System Preferences) automatically turns Nap off at login. Magic!

do shell script "hwprefs cpu_nap=false"

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.