Guide to A good introduction to OneClick.
What Are Floating Palettes?
OneClick's Standard Palettes
How Does it Work?
What Can I Do With OneClick?
Working With OneClick
Don't Be Shy!
Is It Perfect?
|
How Does it Work? That's where macro software is a lifesaver. You turn on "record" mode, do the task once, and the computer memorizes your sequences of mouse moves and clicks, key presses, etc. Play back the macro and those moves are duplicated exactly like you did them. But many times macro software isn't enough. In fact, most of the time it isn't. Human tasks are rarely so generic that a non-thinking machine can just take over. Most of the time a repetitive task involves thinking -- making decisions based upon the current status of things. For example, let's say I've got a folder full of JPEG files but my PC-using colleague needs them all named ".JPG" for his system. Now I could manually go through all those files and rename them, one by one. But that's tedious. That's exactly what the computer was meant to avoid. Using plain old macro software I'm limited. I can memorize selecting a file and changing the name, but how do I tell the computer only to select JPEG files? With macro software there isn't any way -- the macro would work on all files in a folder, not just the JPEG files. OneClick to the rescue. Because OneClick is more than a simple macro player, it can actually analyze my files and rename them appropriately. That's right, using a simple OneClick script, I can tell it to find all JPEG files and rename them to ".JPG"! That's power. How does OneClick do something like that? Well, it's not magic. It takes programming. Yeah, OneClick has its own programming language called Easy Script. But unlike most 90's products, it really lives up to its name.
Scripts in Buttons
Let's open up the "Print" button (the fifth from the left). Here's what it looks like in the Script Editor:
Scripts are just a series of commands. These commands aren't difficult, but it does take time to learn them. You can't expect to master the full scripting power of OneClick overnight. (See Don't Be Shy! for more on scripting.) Briefly, the above script checks to see if the "Print" menu command is available, and if so, it selects it. If it's not available, it beeps and ends. That's it. Pretty simple! This script is actually more complicated than it needs to be. Really the whole thing could be done with one line:
SelectMenu "File", "Print..." In fact, if you clicked on the little "record" button in the above Script Editor and then chose the "Print" command from the "File" menu, it would generate the above short script! The only problem is that if the print command isn't available for some reason (such as there being no document open), nothing will happen. There won't even a be a beep sound to let the user know something didn't work. So technically both scripts function the same -- it's just that the longer one is a bit more sophisticated. Just about any sequence of mouse clicks, menu choices, key presses, etc. can be recorded by the OneClick Script Editor. Anything you do turns into a script -- albeit a simple, linear one. The recording feature is great for simple shortcut buttons that choose an item from a menu, for instance, but more sophisticated scripts require you to learn a little programming. A good example is the "New" button in the ClarisWorks' palette. Because ClarisWorks is an integrated program that supports different kinds of documents, it normally present you with a dialog of document types when you choose "new" from the file menu. The OneClick button, however, presents you with a popup menu of document types allowing you to bypass the dialog! Much faster and more convenient.
This is script is obviously a little more involved than the previous one, but it's not that complicated. The "PopupMenu" command presents a menu of document types (listed between the quotes). The choice -- once the user makes it -- is stored into the variable 'a'. The "if" statement examines the variable 'a' to see which document type the user chose. That choice is eventually passed to the application via an AppleEvent (that's the Process.SendAE command). Something like this could never be recorded, but it's not hard to program. No other scripting environment gives you this much power so simply!
Assigning a Shortcut Key To change or set a shortcut, you edit the button with the OneClick Button Editor. Click in the field labeled "key" and type the combination you want: it can be any combination of Command, Shift, Option, and Control keys. Here I've edited the "Empty Trash" button (part of the Finder Palette) and given it the convenient shortcut Command-T.
Now to empty the trash (if it's full), I just press Command-T. Swoosh! It's gone! If only taking out the real trash was so easy!
|