Black Night Online Reference




1. Introduction

For years, software developers have been trying to convince us that terminal programs don't have to behave like Macintosh Applications.

I say "BOLLOCKS" (an English term), I paid the extra bucks for a Macintosh because I like the way Macintosh Applications behave. So, I've designed Black Night exactly by the book, and I've tried to put the Macintosh 'look and feel' back into Terminal Emulation.

I hope you like it !

1.1 Other Sources of Help

This reference is the definitive source of help. However, I also make extensive use of Balloon Help within dialog boxes, so please feel free to turn this on at any time.

For System 7.5 users, I've also supplied the Black Night Guide file for use under AppleGuide. The guide file provides step by step instructions for some common operations. For the guide file to appear in the help menu, it must be located in the same folder as the Black Night Application.

For scripting, the simplest way is to turn recording on. That way you get a sample script that should be quite a good match to what you're trying to script. A reference of commands specific to this software is included later in this reference. Otherwise, for generic commands, please refer to your AppleScript (or other scripting language) documentation.

For Third Party connection, terminal and file transfer tools, please refer to the documentation that should come with each tool.

1.2 System Requirements

Black Night prefers System Software Version 7.5.1, however I've also successfully tested it on System Software Versions 7.0.1¥, 6.0.7, 6.0.4, 6.0.3 and 4.3 (although some of the advanced features are not available on the earlier versions).

To use "plug-in" connection, terminal and file transfer tools, you need the Communication Tool Box which is built into System Software Version 7.0.0 and onwards, and can be installed into System Software Version 6.0.4 and onwards. However, Black Night's built-in tools are always available.

Most of the verification was done on a Macintosh Quadra 700 and a Macintosh SE, although Black Night has been extensively beta tested on a much wider range of machines.

Black Night will also run on the PowerMac Computers, but only in emulation mode. I'm planning to port the code to native PowerPC code as soon as the PowerPC Object Pascal Compilers become a little more stable.

2. Some Odd Notes

Like any Communications Application, Black Night requires a little setting up. I tried really hard to do most of this for you, and there's a remote chance that you may not need to set up anything at all.

However, you may want to take a moment to browse through the Default Settings (particularly your modem setup), and confirm that everything looks in order.

Don't be concerned if some settings appear to be missing, a lot of the power of Black Night is in it's Artificial Intelligence. For example, don't go looking for the setting that says what sort of line conversion to do when downloading text files, there isn't one. If I can't work it by looking at the file, then I shouldn't expect you to either.

2.1 Default Settings

As a minimum, you probably want to set up the Default Settings. These will be used whenever a new Document or Helper is created.

To check out the Default Settings, make sure you have an empty window in the foreground and select "Session SettingsÉ" from the "Edit" menu. This will open the Session Settings Dialog Box. Everything you can set up in a document is set up from this dialog box.

If this is the first time you've opened this dialog box, then you will notice that the "Default" check box is checked. This means that these settings will become the Default Settings when you click "OK".

2.2 Internet Config

Black Night extensively uses Internet Config and so should you. With Internet Config, you get to set your common preferences for several applications all in the one place.

With Internet Config, you can set up what to do with Downloaded Files, tell me what's your favorite Text Editor, and even tell me your Name, Email Address and Signature so I can put them in the Send Menu for you.

But the really great feature with Internet Config is that you only have to enter these details once and most modern applications will read these preferences and use them as a matter of course.

Installing Internet Config

If nothing else, you should launch the Internet Config application at least once. This will establish the "Internet Preferences" file and (after asking you), will install the Internet Config Component. Taking this step will ensure that all the default file mappings and helper definitions are available to Black Night. Also, take a moment to enter your personal details.

2.3 Shortcuts and Things

Black Night has a few shortcuts and other operations that are not immediately obvious.

Opening a Connection

The quickest way to open a connection is to 'double tap' the enter key. You could also double tap the return key, or the space bar.

Tabled Selections

When you select text in a document the selection follows the Apple 'text edit' shape, i.e. whole lines are selected. If you prefer to select a 'square block', perhaps a table or something, make sure you hold down the Command ( ) key before you click in the document.

Drag and Drop

Drag and Drop works as you'd expect, even within the same document. If there is something on the screen that you wish to send (as if you'd typed it), simply select the text and drag/drop it into a non-selected area of the same window. It will then get sent as if you'd selected "Copy" and then "Paste" (except it won't get saved to the clipboard).

Moving Busy Windows

If you have a 'busy' window (perhaps a file transfer is happening), and you want to move the window out of the way, holding down the Command ( ) key will allow you drag it wherever you want without 'selecting' it.

Keyboard Buffer

Hold down the option key to prevent sending a carriage return after the contents of the keyboard buffer are sent.

2.4 Quirks and Oddities

The Communication Toolbox.

2.5 Printing

When you select "Print" from the "File" menu, Black Night only prints the active terminal area. To print a portion of the active terminal or scrollback buffer, copy, grab or drag the portion of interest into your Text Editor and print it from there.

3. Introducing Helpers

Probably the first thing you noticed about Black Night is that it behaves like a Macintosh Application. You can open as many windows as you like, and all the usual commands such as New, Open and Save behave exactly as you'd expect them to do.

Unfortunately, you probably only have one telephone line and one modem, so multiple windows may not be much use to you. In fact, although the Telnet people will love it, you may find it a nuisance.

So I've introduced the concept of Helpers. Helpers come in several flavors (applications, post processors, documents, resources helpers, telephone numbers and scripts), and are all available at the drag of a mouse.

3.1 Applications

These are the simplest form of helpers and they're just regular Macintosh Applications. The only thing special about about them is that you can launch them from the "Helpers" menu, and sometimes I'll launch them automatically.

Black Night allows you to specify two application helpers; a Text Editor and a Script Editor. The Text Editor is used extensively with Log Files and the Script Editor is used with your Script Documents.

Text Editor

By default, Black Night will use the Text Editor you've nominated in Internet Config. By default this is SimpleText, although you should consider changing this to BBEdit Lite if you regularly work with large log files. If you wish to use a different Text Editor to the one you've nominated in Internet Config, then you should uncheck the box "Use Internet Config Helpers if possible" (select "Helpers" from the "Edit" menu), in which case I'll use the Text Editor you've nominated in the "Helpers" dialog.

Script Editor

A Script Editor is not usually specified in Internet Config, although some applications add this setting. In any event I will always use the Script Editor you specify in the "Helpers" dialog. By default this will be the "Script Editor" application that comes with AppleScript.

3.2 Post Processors

These are also regular Macintosh Applications, but they are only used when you download a file. Most files you download will be compressed, or they will be encoded, or both. When Black Night downloads a file, it does an automatic file type check to identify the type of file and any compression or encoding.

Once identified, Black Night will check Internet Config to see if you've specified a post processor to use with that file type (by default most file types and post processors are pre-specified). If you've checked the box, then Black Night will launch the post processor (e.g. Stuffit Expander, JPEG View), and tell it to open the downloaded file.

3.3 Documents

Black Night can use regular Macintosh documents to save a particular setup. Because you probably only have one modem and one telephone line, you'll probably prefer to use Resource Helpers to save your different setups.

However, if you have more than one modem or you're using MacTCP and Telnet, you may want to have several connection open at once. In this case you should save your settings as documents.

All documents that are saved into the "Home Base" Folder will appear in the "Helpers" menu. Selecting a document from the "Helpers" menu is exactly the same as selecting "Open" from the "File" menu, and selecting the document you want to open; its just a little quicker.

3.4 Resource Helpers

These are the ones you'll probably use the most. Resource Helpers are exactly the same as documents except:

You can add, edit and delete resource helpers by selecting "Helpers" from the "Edit" menu. Note that some terminal programs call these helpers the "Directory" or "Phone list".

Default Window

Whenever you select a Resource Helper from the "Helpers" menu, Black Night searches for the Default Window, and turns it into a document based on the settings saved in the Resource Helper. The Default Window is usually "Untitled 1". However, sometimes Black Night will pick another window if this makes more sense. Black Night will never override a real document (with a file and icon), and will create a new document if there isn't one already available.

If the Default Document is already online, Black Night will ask you if you wish to close the connection before changing anything.

3.5 Group Helpers

Group Helpers are Resource Helpers that have been indexed into a Hunt Group. This concept is best illustrated with an example.

Say your local bulletin board has several lines and hence several telephone numbers. In most instances, the Sysop would have asked the telephone company to put these numbers in a hunt group, so you only have to call one number and you get connected to the first free line. In this case you would set up a single Resource Helper and probably make it retry several times.

However, sometimes Sysops don't do this, or maybe you want to try the telephone number first, and then maybe try via the local Packet Switch Network. In both these circumstances you can create a Group of Helpers, all with the same name, but with different indices (the index is the number in the box after the helper name).

Because they all have the same name, there will only be one entry in the "Helpers" menu (i.e. 'Atlantis'). However, when you select "Atlantis" from the "Helpers" menu, Black Night will notice that it's a Group Helper and will try each one in turn until one of them connects, or you cancel the attempt.

If you want Black Night to quickly step through each one, you should probably set the number of retries in each helper to be fairly low (e.g. 1 or 2), because Black Night will only step onto the next helper when the Connection Tool reports that it has "Failed to Connect". Alternatively you can select "Next Helper" from the "Helpers" menu if you want to immediately move onto the next helper. Because some third party Connection Tools don't return proper error codes, there is also an option to "Stop Group Help". Selecting "Stop Group Help" from the helpers menu unconditionally breaks the helper chain and prevents any further stepping.

3.6 Telephone Numbers

Telephone Number Helpers are useful if you have very simple requirements, or you can't be bothered setting up any Resource Helpers. In fact, you may want to start with Telephone Numbers, and move onto Resource Helpers as you become more familiar with Black Night.

Quite simply, these helpers are a list of telephone numbers. You can modify this list from within the "Apple Modem Tool" (if available), the "Serial Modem Driver", or by clicking the "Modify" button in the "Helpers" dialog box (select "Helpers" from the "Edit" menu).

When you select a Telephone Number from the "Helpers" menu, Black Night will locate the Default Window, revert it back to the Default Settings, change the Telephone Number, and then Connect.

If you have a Telephone Number that has the same name as a Resource Helper or Document, then the Telephone Number will not appear in the "Helpers" menu.

Apple Modem Tool Phone Numbers

All telephone numbers are stored in the file "Apple Modem Tool Phone Numbers". This file is shared with the Apple Modem Tool. Normally, Black Night will resolve any name conflicts that may occur between these entries and your documents or resource helpers.

If you would prefer to manage this file yourself, simply include a comment or a separator line, and I'll reproduce it exactly as you've left it.

3.7 Scripts as Helpers

Your Script Documents can also be a special form of Helper. Any Script Documents saved in the "Home Base" folder will automatically appear in the "Script" menu. Selecting a Script Document from the "Script" menu will automatically load and execute that script.

4. Connection Tools

Black Night uses a connection model based on the Apple Connection Manager. What this means is that its very easy to change the entire connection procedure, without changing anything else.

In fact, if you have the Communications Toolbox installed (it's included with System Software Version 7.0.0 and onwards), its simply a matter of dropping a new connection tool on your system folder and selecting that tool in the "Session Settings" dialog box.

However, note that Black Night does not require the Apple Connection Manager, and that Black Night's built in connection tools will work fine without it.

4.1 Automatic Connection

Sometimes you just want to connect; no helpers, no documents, no telephone numbers, just launch and connect. You can achieve this by checking the "Auto" checkbox in the "Session Settings" dialog box and saving that configuration as the "Default Settings". In fact, you can make Black Night automatically connect, wait for a call, or initiate a dialback sequence.

This same setting applies to Resource Helpers and Documents, and will take effect whenever a Document is opened or a Resource Helper is selected from the "Helpers" menu.

What is Dialback

Dialback is a two stage connection sequence used where security is an issue. With dialback, Black Night will make a call, wait for the call to be cleared, and then immediately go into "Wait for a Call" mode. You should only use dialback when your host knows it's supposed to call you back.

4.2 Login Sequences

If you can never remember your user name, hate typing, or need to navigate several data switches before you finally get connected, then you need Black Night's automated login sequence.

The login sequence allows you to specify 'search strings' that act as triggers. For example, you could set the word 'login:' as the user name trigger. Then, whenever you connect, the first time Black Night receives the sequence 'login:' it will automatically send whatever you've entered as your user name macro.

Black Night's login sequence also has one-off triggers for your password macro, two wildcard sequences, and a "send this shortly after I've connected" sequence. There are also triggers to play a sound, hang up, and there is a repeating wildcard trigger that some people find useful.

You can setup the login sequence by clicking on the "Login" button in the "Document Settings" dialog box (make sure the "Connection" icon is selected). If you get stuck, don't forget to turn on Balloon Help.

4.3 Serial/Modem Driver

The Serial/Modem Driver is built into Black Night; you don't need to drop anything onto your System Folder. You can use the Serial/Modem Driver to control a modem, connect to a data switch, PAD or Terminal Server, or any other device that supports the RS232 interface.

For an explanation of the Serial/Modem Driver settings, you should turn on Balloon Help and browse the "Serial/Modem Driver Settings" dialog box. However, this Connection Tool also has a number of unique features that don't relate to settings and these include automatic "Port in Use" detection, "CTS Assertion" detection, and a "don't hack the hardware" policy.

Port in Use Detection

The Serial/Modem Driver will automatically detect if the Serial Port is already in use by another application. Sometimes it really is in use, and sometimes it just got left open, perhaps by a system crash or some fax software. If the port is found open, then the Serial/Modem Driver will ask whether you want to close it or not.

CTS Assertion Detection

Sometime you'll select Hardware Handshaking and you'll wish you hadn't. If your cable doesn't support Hardware Handshaking, then some Macintosh's will freeze when you open a connection. The Serial/Modem Driver detects this condition, and warns you that it turned Hardware Handshaking off.

4.4 Black Night Connection Set

Black Night's built-in connection tools have now been superseded by the Black Night Connection Set. The Connection Set includes:

These are all Communication Toolbox Connection Tools and can be used with Black Night and any other CTB aware application. Currently they are only available as plug-in tools, but they will eventually be built into a future version of the application.

The Black Night Connection Set can be obtained from the Info-Mac and CompuServe archives (amongst other places).

5. Terminal Tools

Black Night uses a terminal model based on the Apple Terminal Manager. What this means is that its very easy to swap terminals, without changing anything else.

In fact, if you have the Communications Toolbox installed (it's included with System Software Version 7.0.0 and onwards), its simply a matter of dropping a new terminal tool on your system folder and selecting that tool in the "Session Settings" dialog box.

However, note that Black Night does not require the Apple Terminal Manager, and that Black Night's built in terminal tools will work fine without it.

5.1 Using Macros

Black Night allows you to enter your user name, password and five other strings (e.g. 'go mail') as macros. Macros appear in the "Send" menu and get pasted to the terminal whenever you select one.

You enter your macros by clicking on the "Macros" button in the "Session Settings" dialog box (make sure the "Terminal" icon is selected first). The "Password" macro can be concealed. If it is concealed, then you may only send it one time per connection.

Black Night also picks up five common strings from Internet Config, and these are also available from the "Send" menu.

5.2 Scrolling and Logging

Black Night maintains a scrollback buffer and a log file. By default, the scrollback buffer is enabled, and the log file is disabled, although you can change this in the "Session Settings" dialog box. Both functions save screen data whenever it:

In addition, you can save the selected text to the log file by selecting "Log Selection" from the "Session" menu, and even though there is a default setting in the "Session Settings" dialog box, you can turn the log file on and off at any time using the "Suspend Logging" and "Resume Logging" commands in the "Session" menu.

Log files are always stored in the "Home Base" folder.

5.3 ANSI/PC/VT Driver

The ANSI/PC/VT Driver is built into Black Night; you don't need to drop anything onto your System Folder. You can use the ANSI/PC/VT Driver to emulate a Digital VT100 or VT220, or an IBM PC. Because you can redefine the keyboard, the ANSI/PC/VT Driver can also emulate just about any terminal that uses the ANSI standard.

For an explanation of the ANSI/PC/VT Driver settings, you should turn on Balloon Help and browse the "ANSI/PC/VT Driver Settings" dialog box. However, this Terminal Tool also has a number of unique features that probably require further explanation.

Autoswitching between Modes

Because the IBM PC, the VT100 and the VT220 all use ANSI escape sequences, it's quite simple for the ANSI/PC/VT Driver to emulate all three of them. However, there are three main differences and they are:

Fortunately, the IBM PC, the VT100 and the VT220 are sufficiently different that the ANSI/PC/VT Driver can usually detect what the host thinks it is communicating with. So, if you check the "Autoswitch between PC/VT" checkbox in the "ANSI/PC/VT Driver Settings" dialog box, then I'll swap fonts, identity sequences and (provided you've selected the "AutoSwitch" keyboard setting) the keyboard as well.

If you don't like this behavior, you'll need to uncheck the "Autoswitch between PC/VT" checkbox and manually set the "Keyboard", "Terminal" and "Screen" yourself.

Using your own 'KCHR'

If you don't want a redefined keyboard (maybe you've designed your own 'KCHR' resource), select 'None' as the keyboard and Black Night will do no keyboard substitutions.

Unsupported Sequences

Currently, the ANSI/PC/VT Driver does not support:

Although I'll add these features if you really push me.

5.4 Other Terminal Tools

A number of other Terminal Tools are available, either from Apple or third party vendors, and you may want to try some of them out.

VT102 Tool 1.0.2

This is the Genuine Apple Product. It's a perfect VT102, which is pretty boring, but very accurate.

6. File Transfer Tools

Black Night uses a file transfer model based on the Apple File Transfer Manager. What this means is that it's very easy to add additional file transfer protocol handlers.

In fact, if you have the Communications Toolbox installed (it's included with System Software Version 7.0.0 and onwards), its simply a matter of dropping a new file transfer tool on your system folder and selecting that tool in the "Session Settings" dialog box.

However, note that Black Night does not require the Apple File Transfer Manager, and that Black Night's built in file transfer tools will work fine without it.

File Transfer Tools are different from Terminal and Connection Tools in that you don't just pick one and save its particular configuration. All file transfer tools are always available, and the configurations for all tools get saved with your document's settings.

6.1 Sending Files

Black Night has a really complex "Send File" dialog box that you can open by selecting "Send File" from the "Send" menu. It's really complex because it allows you to choose multiple files to send, and you get to select which format you want to send it in.

You can choose MacBinary, Smart Binary, BinHex 4.0, or Smart Text. However, note that these are only available with Black Night's built in file transfer tools. You can also choose which File Transfer Tool to use and what sort of host you are sending to. The host setting affects the declared filename and the type of line endings to use.

Note that you should select the format before selecting the file, the host type can be selected at any time.

MacBinary

Black Night has a built in MacBinary Encoder. This is what you'll normally use if you are transferring a file to another Macintosh, or if you sending it somewhere where somebody else with a Macintosh is going to download it. MacBinary ensures that all the extra Macintosh information gets saved with the file (e.g. the icon, filename, label etc.).

A technical point, its actually a MacBinary II encoder.

Smart Binary

This is what you'll normally use if you are transferring a file to a DOS or UNIX computer, or if you sending it somewhere where somebody else with a DOS or UNIX computer is going to download it. Smart Binary simply adds the appropriate extension to the file name so the far end can tell what sort of file it is. Black Night uses Internet Config to work out what the file extension should be.

BinHex 4.0

This format is similar to MacBinary except that it sends the Macintosh file as a look-alike text file so that it safely gets through electronic mail systems. Black Night's built in BinHex 4.0 encoder also supports Run Length Encoding, which helps reduce the size of the sent file. Black Night also adds the proper MIME 1.0 headers so that electronic mail systems know what they're dealing with.

Smart Text

Use Smart Text with text files that your sending to a DOS or UNIX computer. Smart Text will "wrap" text and insert the right sort of line endings so that the recipient can actually read the file. You can set the wrap parameters in the "Document Settings" dialog box.

6.2 Receiving Files

The file transfer tool you select in the "Session Settings" dialog box is the "Auto-Trigger" file transfer tool. What this means is that you host may automatically initiate a file transfer, using this protocol, without you having to do anything.

However, all the other file transfer tools are also available, and you can start one of them by selecting it from the "Receive" menu. Black Night does a lot of processing of downloaded files.

Post Processing

How many time have you downloaded the latest 43 gigabyte file-from-hell only to discover it appears as a blank icon, and the Finder refuses to open it. I hate that, so I've added a powerful file recognition and typing mechanism. Even raw binary file can usually be identified and decoded to the correct format. Optional post processing, where Black Night will drop the downloaded file onto a user specified "Helper" application, is also available.

File Recognition

Black Night uses the Internet Config system to map file stamps and extensions to file types, and to determine whether to drop the downloaded file onto a helper application. Although you don't require Internet Config, using it will significantly improve Black Night's ability to identify and typecast unencapsulated files. Black Night also uses its own internal "binary stamp" tables.

File Decoding and Conversion

Black Night will automatically recognise, decode and convert MacBinary and Text files. Also, Black Night will recognise BinHex 4.0, MIME 1.0 and most binary file formats and pass them to the appropriate decoder.

6.3 Smart Paste

With Black Night's built in Smart Paste tool, text is sent to the terminal window exactly as if you had typed it yourself.

Automatic Smart Paste

Have you ever selected "Paste" thinking there were only a few characters on the clipboard, and then found that you've just tried to insert pages 104 through 612 of the Moscow Telephone Directory. I do it all the time, so I've developed Automatic Smart Paste to ease the grief.

So, whenever you select "Paste", "Duplicate" or perform a "Drag and Drop", Black Night estimates how long the operation will take, and will automatically invoke Smart Paste if it's going to take more than a few seconds. Smart Paste keeps you informed of progress, and gives you the option to stop if you change your mind.

Taking Care of the Host

To ensure that the Host can keep up with Smart Paste's rapid typing, you can force Black Night to pause at the end of each line. You can also limit the number of character's sent in each burst. Also, Black Night gives you the option to cleanly wrap text before it gets to the right hand margin. All these options are set from the "Session Settings" dialog box.

Pasting Binary Files

As well as text files, Smart Paste can also send binary files using BinHex 4.0 encoding. This feature is useful (for example) if you want to enclose a file with an electronic mail message when your host doesn't support file attachments. You can select the encoding method in the "Send File" dialog box.

6.4 XMODEM and YMODEM

Just about every communications platform supports the XMODEM and YMODEM File Transfer Protocols. Black Night fully implements both, and will automatically synchronise to the variation supported by your host.

All Variations Supported

Black Night supports all common variations of XMODEM and YMODEM including Checksum and CRC-16 Error Detection, Batch Mode Operation, CleanLink Streaming, 128/1024/4096 byte Packet Lengths and Automatic Packet Length Adaptation.

Receiving Files

When receiving, you can select XMODEM, YMODEM or YMODEM-g. In fact, Black Night will receive whatever is sent; the only difference is that the XMODEM Driver requests Checksum Error Detection ("NAK"), the YMODEM Driver requests CRC-16 Error Detection ("C") and the YMODEM-g Driver requests CRC-16 Error Detection with CleanLink Streaming ("G").

Sending Files

When sending, you can select XMODEM or YMODEM. The only difference is that YMODEM sends a description of the file before sending the actual file, as well as allowing you to send multiple files. The packet length, error detection method and streaming options are all automatically negotiated with the host. In addition, Black Night will automatically increase or decrease the packet length depending on the current error rate.

6.5 ZMODEM Preferred

ZMODEM is the preferred transfer method and you should use it wherever possible. The ZMODEM Driver implements most of the commonly used ZMODEM features, and is compatible with a wide range of host implementations.

Setting the Options

Black Night will normally encourage the host to use segmented streaming for maximum safety. However, if you're certain that hardware handshaking is working correctly, then you can turn this feature off (to improve efficiency), by unchecking the "Declare a Receive Buffer of" checkbox. However, in a really difficult environment, you should leave this box checked, and also instruct Black Night to escape all control characters instead of just the common ones.

Selecting any of these options will degrade the transfer efficiency, but will allow faster error recovery in a difficult environment. Typically you don't need to select these options if you are using hardware handshaking and error correcting modems. However, if you are a transiting a packet or telnet network, then you should probably narrow the window and escape all control characters.

Partial Download Recovery

If a ZMODEM download is closed before it completes, Black Night will create a partial download package file. This file contains everything received so far, as well as a description of the download session. Later, if you resume the session, Black Night will search the Receive Folder for a partial download package file that matches the new session. If it finds one, the session will resume where you left off.

Graceful Termination

Have you ever canceled a ZMODEM session only to find that someone forgot to tell the host, leaving you with screens and screens of raw binary data to deal with. It used to happen to me all the time, so I've paid special attention to it.

So, if you cancel a ZMODEM session, Black Night will stay in control until the host has stopped sending data. In most cases, Black Night will detect the exact transition from file transfer to normal mode which means you won't get screens and screens of raw binary data; but you will still get the "Transfer Canceled, Press any Key ..." message from your host.

6.6 Black Night File Transfer Set

Black Night's built-in file transfer tools have now been superseded by the Black Night File Transfer Set. The File Transfer Set includes:

These are all Communication Toolbox File Transfer Tools and can be used with Black Night and any other CTB aware application. Currently they are only available as plug-in tools, but they will eventually be built into a future version of the application.

The Black Night File Transfer Set can be obtained from the Info-Mac and CompuServe archives (amongst other places).

7. Using Scripts

Black Night is Scriptable, Recordable and Attachable. And, according to Michael Spindler (Former President & CEO Apple Computer, Inc.), that's the highest level of support for Apple's Open Scripting Architecture (OSA).

Scriptable

You can script just about every single operation that Black Night can execute. And you don't have to learn a complex new language to achieve this; Black Night uses the regular AppleEvent Suites the way they were designed to be used.

Recordable

I follow a simple rule, if you can script it, then you can record it as well.

Attachable

You can launch scripts directly from the script menu. Very simple, no fuss, and repeatable results every time.

7.1 Convenient Recording

Recording a script in Black Night is very straightforward. Simply select "Start Recording" from the "Script" menu. From that point on, all your actions will be recorded.

When you're done recording, select "Stop Recording" from the script menu, and you'll be presented with the "Save Script" dialog box. The save location will default to the "Home Base" folder.

Once the script has been saved, Black Night will launch the "Script Editor" helper application, and instruct it to open the script you've just recorded.

Recording is not available when recording is already in progress, when a script is being executed, or there is no Scripting Component installed.

7.2 Simple Execution

All scripts that are saved in the "Home Base" folder will appear in the "Script" menu. To execute a script, simply select it from the "Script" menu. Black Night will load the script, compile it if necessary, and execute it.

You can terminate an executing script by selecting "Terminate Script" from the "Script" menu.

Debugging Scripts

While you are working on and debugging a script, you may prefer to execute it from the "Script Editor". You can do this conveniently by selecting "Edit Script" from the "Script" menu. Black Night will launch the "Script Editor" and instruct it to open the script you've selected.

Patience Please

Sometimes, loading and executing a script can be a slow process (up to ten seconds). So, please be patient and give the script a chance before reaching for the reset button !

Technical Warning

The Apple Component Manager does some wicked things to the System Heap that can upset the Apple Connection Manager. I've added quite a bit of extra code to help protect you from this, and I could add some more if required. However, I don't believe I should be managing the System Heap (that's Apple's job), and I'll only do this if absolutely necessary.

You can help by letting me know if you have any problems related to Connection Tools that occur while you are executing a script from within Black Night. I'd really appreciate that !

7.3 Returning a Result

Most scripts return a result which Black Night will display in a dialog box. The result in an AppleScript is always the result of the last function. Sometimes you won't be interested in this result and sometimes you will.

For example, the following script will return "true" or "false":

tell application "Black Night"
wait until connection
of document 1 becomes active
end tell

but the following script is a lot more informative:

tell application "Black Night"
wait until connection
of document 1 becomes active
if result then
return "Yahoo, we're connected"
else
return "Sorry, unable to connect"
end if
end tell

and the following script returns nothing:

tell application "Black Night"
wait until connection
of document 1 becomes active
return
end tell

7.4 Managing Scripts

Black Night will always prompt you to save scripts in the "Home Base" folder. You can actually save them anywhere you like, but I think you'll find the "Home Base" a convenient location.

As a matter of convenience, Black Night has commands to "Edit" and "Delete" scripts. These commands operate exactly like double clicking a script icon, or dragging a script icon to the trash and selecting "Empty Trash" from the finder.

7.5 Communication Suite

Black Night introduces the Communication Suite to supplement Apple's Required and Core Suites. The Communication Suite introduces three new commands:

and nine new classes:

Between the Apple Suites and the Communication Suite, you can script just about every single function that Black Night can perform. For more information on the Communication Suite, please open the Black Night Dictionary by Dropping Black Night on the Script Editor Application.