Events Triggering Scripts Reference Built-In Commands Reference |
[Init]
Message=Please pick a search engine and let me know what you want
me to look for, <YourName>.
Icon=Earth
InputLines=1
List=AltaVista|InfoSeek|Lycos|Excite|Yahoo
OKButton=SearchInternet
CancelButton=Null
You can double click on any script file and the contents of the script will be executed by your CyberSecretary. Usually, however, scripts will be placed in special folders, and will have special names:
Menu – A folder in which scripts are presented as choices if you right-click on your CyberSecretary tray icon. Click for samples.
Outlook – A folder containing scripts which respond to events occurring in Microsoft Outlook. The StartUp, ShutDown, LeftClick and RightClick scripts are also placed in this folder. Click for samples.
Random – A folder containing scripts which run at random times. Click for samples.
New scripts can be easily created simply by right-clicking on any program, document, folder or shortcut and sending it to your CyberSecretary. You can also manually create scripts by right-clicking in any Explorer folder and selecting New | CyberSecretary Script.
Scripts can be edited in any text editor, or you can right-click on your CyberSecretary's dialog while a script is running to edit that script..
Sending
Items To CyberSecretary
The easiest way to create a new script which will launch a program,
open a document or folder, or access an Internet site is to right-click
on any program, folder, document, or shortcut and send it to your CyberSecretary's
desk tray, as shown in this illustration.
NOTE:
If you have Windows 98 installed, or if you have installed the Internet
Explorer 4 Active Desktop, you can not only right-click on files in Explorer
windows, you can also right-click on items on the "Favorites" menu, Start
Menu, Internet History list, and recent document list, and send these to
your CyberSecretary. (See the illustration.)
Your CyberSecretary will instantly appear, so you can "teach" her the new task. You will be asked to specify when you would like the task to be performed (either on a scheduled basis, or as a choice when you right-click on your CyberSecretary's tray icon); whether you would like the task performed automatically or whether you'd like to be asked first; what message and icon you would like displayed; and where you would like your CyberSecretary to appear on-screen.
You will also be given a chance to "fine tune" details of the script, in which case the newly-created script will be opened in your favorite text editor. For example, you may want to modify a script for accessing an Internet site, so that instead of opening the Internet site in your web browser, she will fetch the contents of the Internet page and post it to your Inbox. This could be done by changing the following line:
Editing
Scripts
The easiest way to edit a script is to right-click on the CyberSecretary
dialog box (or press the Windows Menu key) while a script is running.
You will be presented with a menu of choices, including editing the script.
This will cause the execution of the script to end, and the script will
be opened for editing in your favorite text editor. This is a convenient
way to fine-tune a script, if you discover, when the script runs, that
it does not quite do what you intended, or that you'd like to add some
new function or option.
As noted above, you can also edit any script by right-clicking it in any Explorer window and choosing Edit.
Renaming
Scripts
One of the choices when right-clicking on a running script is to rename
the script. Some scripts (e.g. scheduled scripts) follow a naming
convention which controls their function; renaming the script will alter
that function. For example:
Pressing the {Esc} key while a script is running will also terminate the script.
Note: Since most scripts are automatically triggered based on their name, you can suspend the future execution of a script without permanently deleting the script simply by renaming it; e.g. rename Dly1010.cyb as xDly1010.cyb.
The CyberSecretary script language is based on Directives for specifying appearance and behavior of the script. Each section of a script includes one or more directives, each followed by a value. The rest of this document will describe each of the recognized script directives, and indicate how it can be used in scripts.
Controlling
Appearance
The most basic script directives control the appearance (Caption=,
Message=, Icon= and Picture=), Sound=, and screen position
(XPos=, YPos=) of the CyberSecretary dialog.
The Message directive is used to specify the message which is to appear inside your CyberSecretary's "speech balloon." Normally there is space for about six lines of text. However, please note that if more text is specified than will fit, the balloon automatically expands to cover it.
You may display longer messages (more than about 200 characters; up to what will fit on the screen) simply by specifying the name of a text file as this parameter. This will cause the program to read the contents of the text file and display it as a message.
In either case, the specified message may include the following variables, which must be enclosed in angle brackets, and which are case sensitive. These angle brackets will automatically be replaced with the specified information, as follows:
The name (preferred form of address) of the user:
The full name of the user.
<MyName>
The CyberSecretary’s first name.
<Date|mmmm d, yyyy>
The current date in long format, e.g. September 1, 1997. The format
can be customized:
dddd
ddd dd d mmmm
|
Day of the week, e.g. Monday
Day of the week, abbreviated, e.g. Mon. Date of month with leading zeros, e.g. 01 Date of month without leading zeros, e.g. 1 Month, e.g. September
|
The current date in short format, e.g. 9/1/97.
<Time|h:mm ampm>
The current time.
<Subject>
The subject of the last specified Outlook item.
<EventTime|h:mm ampm>
The date associated with the last specified Outlook item. In the case of an appointment, this will be the current date and time. In the case of a task, this will be the due date. In the case of a Journal item, this will be the ending date and time. You may specify a format for this date or time following the vertical bar.
<Contact>
The name of the first contact associated with the Outlook item. In the case of a contact item, this will be the full name of the contact. For a mail message in the Inbox, this will be the name of the sender. For any other type of item this will be the first named recipient.
Gender=Male|Female
This directive controls the gender of the CyberSecretary. If
this directive is omitted, the default gender (chosen at the time CyberSecretary
was first installed) will be read from the Registry.
Picture=Smile|Laugh|Sad|Angry|Talk|Straight
This directive controls the facial expression of the CyberSecretary.
If this directive is omitted, Smile will be used as the default.
Icon=Icon
Controls the icon that is displayed in the CyberSecretary dialog.
The name of the icon refers to an entry in the CyberSecretary icon index,
ICONS.INI in the CyberSecretary program folder. You may select any
icon name appearing in the [Icons] section.
This file may be customized to add new icons. Simply include an entry in
the [Icons] section as follows:
The library must also be specified in the Library] section of ICONS.INI, showing the full path to the library; e.g.:
Sound=Sound
Causes a .WAV file to be played when the script section is executed.
The .wav extension may be omitted. If the path is omitted, CyberSecretary
will look in the \Sounds subfolder of its program folder. CyberSecretary
comes with a library of useful voice clips and sound effects.
Note: You do not need to specify a sound. If you do not specify a sound, CyberSecretary automatically uses a set of predefined sound effects, with the following names: SHOW, HIDE, CLICK, INPUT and ERROR.
XPos=0
to 100
Controls the horizontal position of the CyberSecretary dialog on the
screen. The range is from 0 to 100, with 0 being the left edge of
the screen, 100 being the right edge of the screen, and 50 being centered.
By default, the dialog is centered. However, if you specify a location
in any section of the script, the dialog will remain at that position through
subsequent script sections until you move it.
YPos=0
to 100
Controls the vertical position of the CyberSecretary dialog on the
screen. The range is from 0 to 100, with 0 being the top edge of
the screen, 100 being the bottom edge of the screen, and 50 being centered.
By default, the dialog is centered. However, if you specify a location
in any section of the script, the dialog will remain at that position through
subsequent script sections until you move it.
Displaying
As An Icon
You can write a script which will display your CyberSecretary on screen
as an icon or avatar; i.e., without the full dialog box. This is
useful if you want your CyberSecretary to discreetly appear on screen with
information, and to respond further only if requested.
Your CyberSecretary will automatically appear as an icon (avatar) if the following conditions exist:
Buttons
And Commands
Unless all you want to do is write scripts to display messages (see,
for example, the predefined script Tell Me The Time.cyb), the "real"
work of CyberSecretary is done through commands, which are usually triggered
when the user selects a particular button. There are a number of
script directives for specifying which buttons are to appear, and which
commands are to be executed when that particular button is pressed.
Note that commands can include the following:
BkgCommand=Commands
Any command specified by the BkgCommand= directive will be executed
while the CyberSecretary dialog is displayed, and before any button is
pressed. The following script, for example, will launch Calculator
with a confirming message:
CancelButton=Commands
Any command specified by the CancelButton= directive will cause
a Cancel button to appear in
your CyberSecretary's dialog. The specified command will be run if
this button is pressed. Note that the Cancel
button can appear only with the OK
button.
Normally, the Cancel button will be followed by the null command, and pressing the Cancel button will cause the script to terminate. (A user can also terminate a script by pressing the {Esc} key.)
YesButton=Commands
Any command specified by the YesButton= directive will cause
a Yes button to appear
in your CyberSecretary's dialog. The specified command will be run
if this button is pressed. Note that the Yes
button can appear by itself, or with the No
button or the Snooze
button.
NoButton=Commands
Any command specified by the NoButton= directive will cause
a No button to appear
in your CyberSecretary's dialog. The specified command will be run
if this button is pressed. Note that the No
button can only appear with the Yes
button.
Snooze=Minutes
If the Snooze= directive is present, a Snooze
button will be displayed. Pressing this button will cause
the script to be "snoozed" for the specified number of minutes. The
script will resume execution after the specified number of minutes.
Note: the user can press the Snooze
button repeatedly. Also, even if no Snooze
button appears, the user can right-click on the CyberSecretary
dialog (or press the Windows Menu button) and snooze the script for a user-selected
amount of time. The Snooze
button can only be displayed with either the OK
button or the Yes button.
Default=Yes|No|OK|Cancel|Snooze
This directive specifies which button is to be the default; that is,
which button is pressed if the user presses {Enter} (or, if no text
box or list box is shown, the spacebar). If this directive is not
specified, by default the OK button
or the Yes button (whichever
is shown) is the default.
As with any good Windows application, you can use the keyboard to select buttons by pressing Alt followed by the underlined letter (mnemonic) on the button. For example, press Alt-O to choose the OK button, Alt-Y to choose the Yes button, Alt-N to choose the No button, or Alt-Z to choose the Snooze button. Press {Esc} to choose the Cancel button.
CyberSecretary goes one step further toward simplicity. As long as no text box or list box is displayed, you can simply press the appropriate letter for the button: O, Y, N, Z or {Esc}.
List=List
This directive causes a drop-down list box to appear, displaying the
items shown in the list. This directive has two uses:
[InternetSites]
Altavista=http://www.altavista.digital.com
Yahoo=http://my.yahoo.com
Microsoft=http://www.microsoft.com/Outlook
Wait=Seconds
This directive controls how long the CyberSecretary dialog is displayed.
It is only effective if no button, list or text box is displayed, i.e.
the CyberSecretary is merely displaying a message. The default is
3 seconds. Use this command to specify a longer or shorter display
time.
Earliest=Time
This directive limits the time of day that a particular script section
will be run. The time must be specified in 24-hour format, including
a colon. If the script is executed before the time specified by the
Earliest= directive, the script section will be skipped. For
example, the following script will display a message only if the script
is run after 6:00 p.m.:
Latest=Time
This directive limits the time of day that a particular script section
will be run. The time must be specified in 24-hour format, including
a colon. If the script is executed after the time specified by the
Latest= directive, the script section will be skipped. For
example, the following script will display a message only if the script
is run before 10:00 a.m.:
NextSection=Section
This directive specifies the next section which will be executed, unless
the user presses a button that points to a different script section.
If no next section is specified, the script will terminate. The following
script section will branch to different sections depending on the button
pressed by the user.
Branching
As the preceding example shows, it is possible to have a script perform
different actions depending on input from the user. In the above
example, if the user presses Yes, the script will branch to the
[Print] section. If the user presses No, the script will branch
to the [Finished] Section.
You can have a script offer more than two choices using the List= directive. The following script, for example, presents the user with five choices, each pointing to a different script section for carrying out the task:
[Choices]
Search The Internet=[Internet]
Check New Mail=[Mail]
Check Diary=[Diary]
Today's News=[Yahoo]
Nothing=[Finished]
Looping
It is also possible to have a script perform simple looping.
Please note, CyberSecretary does not presently support loop structures
such as For..Next or While..Wend. You can, however,
have one or more script sections execute repeatedly until the user presses
a button to exit. For example:
[File]
Message=Would you like to save this message as a file, <YourName>?
Icon=FileCabinet
YesButton=SaveFile CurrentItem|DeleteItem CurrentItem
NoButton=null
NextSection=Loop
[Loop]
Message=Would you like to see the next message, <YourName>?
Icon=MailMessage
YesButton=[Init]
NoButton=[Finished]
[Finished]
Message=Let me know if I can do anything else, <YourName>.
Icon=Coffee
Wait=2