home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 3
/
Merciful_Release_3.bin
/
software
/
d
/
data_division_docs
/
datadivisiondocs02.dms
/
datadivisiondocs02.adf
/
12
< prev
next >
Wrap
Text File
|
1996-10-14
|
7KB
|
173 lines
Chapter Eleven
The Scripts Editor ..............................133
The Editor ......................................134
The Script Editor Menus .........................136
Sample Scripts ..................................137
The Scripts Editor
Scripts are a new feature for Opus 5.5. A Script is a special type of
Opus button which is invoked when a specific event occurs. As with Opus
buttons, menus and hotkeys, Scripts may define a set of instructions
which include any mix of AmigaDOS, Workbench, ARexx, script or internal
Opus 5 commands.
Opus can call a Script whenever any of the following system events
occur:-
Bad disk inserted: Activated whenever a disk of unknown format is
inserted into any floppy drive. As an example, this
Script could be used to prompt the user to format the
disk.
Close buttons: Activated whenever a Button Bank is closed.
Close group: Activated whenever a Group window is closed.
Close lister: Activated whenever any Lister is closed.
Disk inserted: Activated whenever a disk of known format is inserted
into any floppy drive. As an example, this Script could
be used to play a sound file or make a beep when you
insert a disk. Alternatively it could automatically open
a lister and display the contents of the inserted disk.
Or even both?
Disk removed: Activated when a disk is removed from any floppy drive.
Maybe use this to play a different sound?
Directory Opus 5 113
Double-click: Activated when the LMB is double-clicked on any clear part
of the Opus 5 Main Window, but it is not activated when
the mouse is over any other Opus element such as a lister
or button bank etc. One handy use for this Script is to
open a new lister or device list as shown below.
Hide: Activated when Opus 5 is iconified.
Middle double-click: Activated whenever the MMB is double-clicked
providing the mouse is not over any button which
has a MMB function defined. This Script will even
be activated if Directory Opus is not the active
process.
Open buttons: Activated whenever any Button Bank is opened.
Open group: Activated whenever any Group window is opened.
Open lister: Activated whenever a Lister is opened.
Reveal: Activated when Opus is de-iconified, by pressing the hot key
combination, Ctrl + lshift + lAlt, for example.
Right double-click: Activated whenever the RMB is double-clicked and the
mouse is not in a position which would normally
activate a menu or a RMB function for any button.
Shutdown: Is executed immediately before Opus 5 quits.
Startup: Is executed when Opus 5 is first started.
The Editor
The Script Editor displays the names of all of the events supported by
Opus and allows you to add, edit or delete the command instructions
attached to each event. An event which has attached commands is shown in
white (Colour 1), while events with no defined commands is shown in black
(Colour 2).
134 Directory Opus 5
*** See Fig 11-01 ***
Scripts: Displays names of the available Scripts. Scripts which have
functions attached are shown in a highlighted colour.
Delete: Deletes the function associated with the selected Script.
Edit: Allows you to edit the functions attached to the selected Script
with the Opus Function Editor. The Function Editor can also be
opened by double-clicking on the desired Script.
Save: Saves the currently displayed Scripts to disk and updates those
currently used by Opus. Note that this saves the Scripts using
the 'current' filename, that is, the name under which the Scripts
were loaded. Any previous file of this name will be overwritten.
Use: Updates the Scripts currently used by Opus but does not save them
to disk.
Cancel: Cancels all changes you have made to the Scripts.
Diectory Opus 5 135
The Script Editor Menus
As with the other editors in Opus 5, there are extra options provided by
menus. These are:-
The Project Menu
New: Creates a new blank Script list.
Open: Displays a file requester allowing you to load a new set of
Scripts.
When first run, Opus uses a default filename for the Scripts file. Once
you load a new set of Scripts using a different name, this new name will
be kept and used internally as the reference to those Scripts. If you
subsequently save the particular set of Scripts, they will be saved under
this name unless you use the SaveAS option. If you save the Environment,
this 'new' filename will be stored with the environment.
Save: Saves the displayed Scripts to disk under the current name.
SaveAs: Saves the current Scripts but allows you to select a new
filename.
Quit: Same as Cancel above.
The Edit Menu
Reset to Defaults: Resets the Scripts to the default set as defined when
you installed Directory Opus 5. Because there are
many settings, these defaults are not actually built-
in to Opus 5, instead Opus will look for and load a
special default file.
Last Saved: Reloads and installs the last saved set of Scripts.
Restore: Abandons any changes you have made and restores the Scripts to
the state as when you first opened the Script Editor.
136 Directory Opus 5
Sample Scripts
Opus 5.5 comes with just two simple Scripts installed. These are :-
Double-Click: This is set to call the command 'DeviceList NEW' which will
open a new Lister whenever you double-click the LMB on the
Opus Main Window.
Middle Double-Click: Runs the AmigaDos command NewShell to open a new
Shell window on either your Opus screen, if it has
been set to Default Public Screen, or the Workbench
screen.
There are many easy and simple uses for Scripts. Try the following for
the disk inserted and disk removed Scripts. Add the command, 'PLAY QUIET
<sound>' where <sound> is the full file path to a favourite sound
effect.This page is left intentionaly blank.
Directory Opus 5 137
This page is left intentionaly blank
138 Directory Opus 5