BBAutoComplete Manual
This manual is also available in BBAutoComplete’s Help menu, as a PDF (165K), and as multi-page online help.
Contents
1 Introduction
BBAutoComplete adds word auto-completion to Affrus, BBEdit, Mailsmith, Microsoft Word, Script Debugger, Smile, Tex-Edit Plus, and TextWrangler. You type the start of a word, press a key, and BBAutoComplete types the letters to complete the word. If BBAutoComplete guessed wrong, you can keep pressing the key to cycle through other possible completions. Other auto-completion utilities need to be taught the abbreviations and expansions that you use; BBAutoComplete avoids this hassle by automatically looking for expansions in the program’s open documents. This means that it always suggests completions that are relevant to your current task.
BBAutoComplete is probably most useful for programmers, who need to remember and type long variable and method names, but it can also help with prose writing. It’s useful any time you need to type long words quickly and accurately.
2 Requirements
BBAutoComplete is a universal binary that runs natively on both PowerPC- and Intel-based Macs using Mac OS X 10.3–10.5. BBAutoComplete works in the following programs:
- Affrus 1.0 and later
- BBEdit 6.0 and later (not BBEdit Lite)
- Mailsmith 1.5 and later
- Microsoft Word from Office 2004
- Script Debugger 3.x (as of version 4.0.4, Script Debugger 4 is not scriptable)
- Smile 2.6.9 and later
- Tex-Edit Plus 4.5 and later
- TextWrangler 1.5 and later
If you know AppleScript, you can hook it up to other scriptable text editors. If you do, please send me your glue script, so that I can include it with the BBAutoComplete distribution.
If you use Mac OS 9 or earlier, you might instead try the Word Completion BBEdit plug-in from FL Package.
At present, I know of no Cocoa applications that are AppleScriptable enough to work with BBAutoComplete. However, Cocoa applications can use TextExtras, which provides a similar auto-completion feature. (It only looks for completions in the front window, and it doesn’t let you choose the word characters.)
3 Installation and Updating
3.1 Updating From a Previous Version
Updating BBAutoComplete is just like installing it. You should replace the application and its associated AppleScripts with the latest versions. If you have made modifications to the AppleScripts, be sure to transfer them when you update the scripts.
3.3 Integration Scripts
BBAutoComplete includes AppleScripts that let you can invoke it from inside other programs. To access these scripts, choose Show Scripts from the BBAutoComplete menu.
These scripts need to be installed in particular locations so that they show up in the Scripts menus of the aforementioned programs.
- The Affrus scripts go in the Scripts folder next to the Affrus application. To open this folder, you can choose About The Scripts Menu from Affrus’s Scripts menu, and then click the Open Scripts Folder button.
- BBEdit scripts go in the Scripts folder inside ~/Library/Application Support/BBEdit/. You may need to set the trigger keys after installing the scripts.
- The Mailsmith script goes in the Scripts folder in ~/Library/Application Support/Mailsmith Support/.
- To use the Microsoft Word script, install Fast Scripts Lite. (Or you can purchase the more fully featured FastScripts to support Daniel Jalkut’s excellent work.) Put the BBAutoComplete script file in the folder ~/Library/Scripts/Applications/Word/ (creating that folder, if necessary). Then open FastScripts Lite’s preferences and assign the script a keyboard shortcut.
- Script Debugger scripts go in the Scripts folder next to the Script Debugger application.
- To install the Smile scripts, make sure that you have Smile installed and then run the Installer program in the For Smile Users folder.
- Tex-Edit Plus scripts go in the Scripts folder next to the Tex-Edit Plus application.
- TextWrangler scripts go in the folder ~/Library/Application Support/TextWrangler/Scripts for TextWrangler 2.0 and in ~/Library/Application Support/TextWrangler Support/Scripts for TextWrangler 1.5.
You may need to create these support folders inside the ~/Library/Application Support/ folder. For more information, see Chapter 2 of the BBEdit, Mailsmith, or TextWrangler manual.
The Launch and Quit Scripts folder contains optional scripts that open BBAutoComplete when you open your editor, and quit it when your editor quits. The Launch BBAutoComplete script goes in BBEdit, Mailsmith, or TextWrangler’s Startup Items folder, or in Smile’s ~/Library/Application Support/Smile/More stuff/Initialization/ folder (which you may need to create). The Quit BBAutoComplete script goes in BBEdit, Mailsmith, or TextWrangler’s Shutdown Items folder. It may be necessary for you to create the Startup Items and Shutdown Items folders. You might find it inconvenient to use these scripts if you use more than one of the programs.
4 Using BBAutoComplete
To use BBAutoComplete, type the first few letters of a long word in one of the supported applications. Then invoke the BBAutoComplete AppleScript from the Scripts menu, or use a keyboard shortcut (Command-/ by default). BBAutoComplete will insert the letters to complete the word. If you aren’t happy with the completion BBAutoComplete chose, invoke the BBAutoComplete AppleScript again. You can do this repeatedly to cycle through possible completions.
The order in which BBAutoComplete suggests completions is deterministic. With a little practice you’ll be able to predict what BBAutoComplete will suggest, and how many completions you’ll need to cycle through to get the one you want. Here are the rules:
- First, BBAutoComplete looks backwards, from the current insertion point to the beginning of the document. That is, the first completion it suggests is the last word you typed (that matches).
- Next, BBAutoComplete looks forwards, from the current insertion point to the end of the document.
- Next, it looks in the other windows, front to back, in layer order. In Mailsmith, BBAutoComplete also looks in the subject, body, and notes fields of message windows; and in the preview panes of the Mail Browser and mail list windows.
- Finally, it uses Mac OS X’s spell checker to find additional completions, if you have that option checked in the preferences.
- Completions are case-sensitive. Letters and numbers are considered word characters; whitespace, punctuation, and other symbols are not. You can add more word characters in the Preferences window.
Note that this auto-completion algorithm is the same as dabbrev-expand (M-/) in GNU Emacs, except for being case-sensitive. If you don’t know what Emacs is, stick with BBEdit; if you do, well, that explains why the auto-completion works differently than, say, Xcode’s.
4.1 Changing the Trigger Key
In BBEdit, Mailsmith, or TextWrangler, choose Scripts from the Palettes submenu of the Window menu. Click on BBAutoComplete in the palette that opens, and then click the Set Key... button.
In Script Debugger or Affrus, choose Show Scripts from the Palettes submenu of the Window menu. Click on BBAutoComplete in the palette that opens, and then choose Set Keystroke... from the down-pointing triangle menu opposite from the Edit button.
In Smile and Tex-Edit Plus, you can change the key by modifying the letters at the end of the script file’s name. For the details of how this works, please consult the Smile and Tex-Edit Plus documentation.
4.2 Ignoring Background Windows
By default, BBAutoComplete looks for completions in all of front program’s open text windows. However, background windows containing lots of text will slow down BBAutoComplete. To make BBAutoComplete look for completions in only a single window, use the included BBAutoComplete (Front Only) script instead of the BBAutoComplete script.
4.3 Hiding the Dock Icon
You can remove BBAutoComplete from the Dock using the free Dockless utility. You’ll need to make the Dock icon visible again in order to configure BBAutoComplete’s preferences or view its help pages.
If Dockless doesn’t work on your system, you can also hide BBAutoComplete’s Dock icon manually. Hold down the Control key and click on the BBAutoComplete icon in the Finder. Choose Show Package Contents from the menu. Open the Contents folder, and then open the Info.plist file. At the bottom of Info.plist, change:
<key>LSUIElement</key> <string>0</string>
to:
<key>LSUIElement</key> <string>1</string>
Then save the Info.plist file and relaunch BBAutoComplete. To make BBAutoComplete’s Dock icon visible again, change the Info.plist file back; that is, change the 1 back to a 0.
5 Menus
5.1 The BBAutoComplete Menu
5.1.1 About BBAutoComplete
The About BBAutoComplete window shows the credits, as well as download and support information.
You can always download the latest version of BBAutoComplete from the BBAutoComplete Web site.
Questions about BBAutoComplete may be sent to bbautocomplete@c-command.com. I’m always looking to improve BBAutoComplete, so please feel free to send any feature requests to that address.
To make sure that you have the latest version of BBAutoComplete, you can use the Software Update feature or subscribe to the BBAutoComplete News mailing list. The traffic on this list is very low, only one message per new version of BBAutoComplete.
The BBAutoComplete RSS feed contains update notices and other BBAutoComplete news.
The BBAutoComplete forum is the place to talk with other BBAutoComplete users, share tips and tricks, and ask questions.
5.1.2 Software Update
Click the Check Now button, and BBAutoComplete will tell you whether a newer version is available for download. By default, BBAutoComplete will automatically check for new versions each time it is launched and once per day. You can disable this feature by unchecking the checkbox.
If a new version is available, BBAutoComplete will tell you what’s new in that version. Click Download to have BBAutoComplete download the .dmg file for the new version to your Internet downloads folder. Click Download & Install to have it download the .dmg and then update the installed BBAutoComplete application to the new version.
To check for a new version, BBAutoComplete contacts a Web server at dreamhost.com. BBAutoComplete transmits the following information to the server: the name of the product (BBAutoComplete) and its version, the version of Mac OS X, whether BBAutoComplete is registered, and the name of the current language. This information is used to guide future development. No personal information is transmitted.
6 Preferences
6.1 Find completions using spell checker
This option causes BBAutoComplete use Mac OS X’s built-in spell checker to find additional completions for the text that you’ve typed, after you’ve cycled through all the completions available in the current window and other open documents. This is useful when the open documents don’t contain much text, and therefore aren’t very useful for suggesting completions. It can also be used to help type words that you aren’t quite sure how to spell. One reason to turn this option off would be if you often cycle through the whole list of completions and want to avoid cycling through a potentially long list of suggestions from the spell checker.
6.2 Use word cache
This option makes BBAutoComplete faster at suggesting completions, at the expense of using additional memory.
6.3 Extra word characters
Depending on the kind of words that you type, you may want to adjust BBAutoComplete’s list of word characters. The effects of doing this can be surprising. For example, if you add . (period) as a word character, and your document contains:
foo.html www.apple.com
Then you will be able to complete:
f
to:
foo.html
or:
w
to:
www.apple.com
On the other hand, if your document contains:
foo.method()
you would not be able to complete:
bar.m
to:
bar.method
because BBAutoComplete will see the foo.method as a single word. When . is not a word character, the method is seen as a separate word, and so it can be used for completion.
7 Legal Stuff
Distribution
Please distribute the unmodified BBAutoComplete-1.5.2.dmg file on the Web, LANs, compilation CD-ROMs, etc. You may not charge for it (beyond a reasonable cost for media) or distribute the contents of the disk image file in isolation. You may not distribute your serial number.
Limited Warranty
The software is provided “as is,” without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
License
A license for BBAutoComplete is good for one person or one computer. You may install it on one Mac, and everyone sharing that Mac may use it (on that Mac). Alternatively, you may install it and use it on multiple Macs (e.g. your desktop Mac and your laptop); then you (and no one else) may use it on any of those Macs. For multiple users on multiple Macs, you should purchase multiple licenses.
Copyright and Trademarks
BBAutoComplete and this manual are copyright © 2002–2008 by C-Command Software. All rights reserved.
BBAutoComplete is a trademark of C-Command Software. Mac is a registered trademark of Apple Computer. All other products mentioned are trademarks of their respective owners.
Components
The following open-source components are used in BBAutoComplete:
Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England.
Core Foundation is available under the terms of the Apple Public Source License.
Growl is Copyright © The Growl Project, 2004-2007 All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Growl nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Thanks to Allan Odgaard for some code snippets that are used in the Software Update installer.
8 Version History
- 1.5.2—January 9, 2008
- Fixed bug where BBAutoComplete was needlessly logging to the console.
- The software updater is better at handling invalid downloads folders.
- 1.5.1—November 14, 2007
- Fixed bug where the Apple Help didn’t work on Mac OS X 10.5.
- Fixed bug where the Software Update checker didn’t always re-check for new updates.
- The Software Update feature now checks whether the updated version can run on your installed version of Mac OS X.
- Modernized the crash reporter code.
- Fixed help book icon.
- 1.5—February 7, 2007
- BBAutoComplete now requires Mac OS X 10.3 or later.
- Now works with Microsoft Word.
- Added Find completions using spell checker option. This is useful when the open documents don’t contain much text, and therefore aren’t very useful for suggesting completions. It can also be used to help type words that you aren’t quite sure how to spell.
- Can now find completions in BBEdit and TextWrangler results browser windows.
- Rewrote the Software Update feature. When a new version is available, it can now show you the release notes. BBAutoComplete now downloads the new version itself, rather than relying on your browser. The Download & Install button will cause BBAutoComplete to auto-update itself to the latest version. Also, the software update checker now works behind HTTP proxies.
- Added keyboard shortcut for Hide Others.
- Improved compatibility with pre-release versions of Mac OS X 10.5.
- Added Danish localization.
- 1.4.2—January 25, 2006
- BBAutoComplete is now a universal binary.
- Can now look for completions in the preview panes of BBEdit and TextWrangler disk browsers.
- If Path Finder is running, the Show Scripts command reveals the scripts using it instead of the Finder.
- The Software Update alert is now a sheet, so it won’t interfere with auto-completion.
- Improved scaling of the icon.
- 1.4.1—February 7, 2005
- Now supports TextWrangler 2.0’s documents drawer.
- The Front Only Smile script now works with European keyboards.
- Added example of changing the word characters.
- 1.4—January 10, 2005
- Now works with Smile.
- Fixed bug where BBAutoComplete sometimes didn’t realize that the front window’s text had changed, and so it returned the wrong completion.
- 1.3—September 21, 2004
- Now works with Affrus.
- In BBEdit 8, now supports shell worksheets and multiple documents in the same window.
- The AppleScripts are now packaged inside the application; they can be accessed using the Show Scripts command in the BBAutoComplete menu.
- Added software update checker and crash reporter.
- Added Close All Windows and Minimize All Windows commands.
- Now requires Mac OS X 10.2 or later.
- 1.2—August 13, 2003
- Now works with Script Debugger, Tex-Edit Plus, and TextWrangler.
- Added new icon.
- Refined and updated the interface.
- Added Apple Help.
- Fixed bug in Mailsmith script.
- The Quit script no longer cancels logout.
- 1.1.2—March 26, 2002
- Now works with Mailsmith 1.5.
- 1.1.1—March 18, 2002
- Removed profiling code, so no longer creates gmon.out files at root of the boot volume.
- 1.1—March 16, 2002
- Parsing words is between 20 and 70 times faster than in 1.0.1 (for an 80KB window), with greater improvements on low-memory systems.
- The new word cache further speeds processing.
- BBAutoComplete can optionally ignore background BBEdit windows.
- Includes an Open BBAutoComplete script for BBEdit’s Startup Items folder.
- 1.0.1—February 27, 2002
- The Quit AppleScript is saved as an application now—so it works.
- 1.0—February 26, 2002
- First public release.