Be TaskManager Documentation

Up  Index


Scripting Properties

Scripting properties expose the functionality of applications to scripting languages. This allows to automate common tasks by combining multiple applications to archive a goal. There a plugins available for various scripting languages to access these properties. For the examples in this document I used the small command line application "hey". It is available for download from BeBits.

Be TaskManager exposes two types of scripting properties:

Team List Properties

The team list is a property of the application and gives access to the running teams and their properties. The following table lists the properties of the team list.

Name what Field Specifier Data Type Description
Team B_COUNT_PROPERTIES B_DIRECT_SPECIFIER int32 Returns the number of teams.
any B_INDEX_SPECIFIER
B_REVERSE_INDEX_SPECIFIER
B_NAME_SPECIFIER
B_ID_SPECIFIER
- Directs the scripting message to the specified team.

Every team has the following scripting properties:

Name what Field Specifier Data Type Description
ID B_GET_PROPERTY B_DIRECT_SPECIFIER int32 Returns the team ID.
IsSystemTeam B_GET_PROPERTY B_DIRECT_SPECIFIER bool True if the team is part of the BeOS (e.g. the Tracker application is a system team).
IsIdleTeam B_GET_PROPERTY B_DIRECT_SPECIFIER bool True if this team contains the idle threads for each CPU (normally this is the kernel_team).
TheadCount B_GET_PROPERTY B_DIRECT_SPECIFIER int32 The number of threads.
AreaCount B_GET_PROPERTY B_DIRECT_SPECIFIER int32 The number of areas (see the kernel kit documentation for more information on areas).
ImageCount B_GET_PROPERTY B_DIRECT_SPECIFIER int32 The number of images (see the kernel kit documentation for more information on images).
Filename B_GET_PROPERTY B_DIRECT_SPECIFIER string Full filename of the executable.
Priority B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER int32 The priority. Possible values are in the range 1 to 120. If the priority is in the range 1 to 99 it is a time-sharing application. If the priority is greater than 100 it's a realtime application.
Kill B_EXECUTE_PROPERTY B_DIRECT_SPECIFIER - Kills the team without any warning.
Quit B_EXECUTE_PROPERTY B_DIRECT_SPECIFIER - Quits the team.
Activate B_EXECUTE_PROPERTY B_DIRECT_SPECIFIER - Activate the team (bring main window to front).

This example gets the filename of the TaskManager executable:

hey application/x-vnd.task_manager get Filename of Team "TaskManager" of Teamlist

GUI Properties

Through scripting properties you can access and change most of the UI elements of Be TaskManager. Additional to the normal BeOS UI elements BeTaskManager contains a list of non-standard UI interface elements like CGraphView, which displays the CPU usage history in the usage tab. The following list contains a short discription of all those UI elements and their script properties.

CColumnListViewEx

A column list view like the one in the "Teams" tab.

Name what Field Specifier Data Type Description
Column B_COUNT_PROPERTIES B_DIRECT_SPECIFIER int32 Returns the number of columns.
any B_INDEX_SPECIFIER
B_REVERSE_INDEX_SPECIFIER
B_NAME_SPECIFIER
- Directs the scripting message to the specified column.

Every column has the following scripting properties:

Name what Field Specifier Data Type Description
Label B_GET_PROPERTY B_DIRECT_SPECIFIER string Column label.
Visible B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER bool True if this column is visible. If the current value is changed the column is hidden or shown, depending on the value of "data".
Width B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER float Column width.
SortMode B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER int32 0=ascending, 1=descending, 2=no sort. If you change the sort mode from "no sort" to ascending or descending the column is added as sort key. The sequence in which the sort keys are added is relevant. The first added sort key gets the primary sort key, the second added the secundary and so on.

This example displays the label of the first column of the team list view:

hey application/x-vnd.task_manager get Label of Column 1 of View 4 of View 0 of View 1 of View 0 of View 0 of View 1 of Window 0

CGraphView

An example for this view is the CPU usage history displayed in the usage tab. It contains a list of "data provider" objects. Every data provider reports the current state of some system resource e.g. the current CPU usage. Because a graph view displays the history of such a data provider, it stores the information in a "data info" object. Such a object contains all the information needed to display a data provider: color, scale and history.

Name what Field Specifier Data Type Description
AutoScale B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER bool If this property is set to true, the maximum value is ajusted to match greates value currently displayed.
PointDistance B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER int32 Distance between the two points of the line which connects two values of the history (in pixel).
GridSpace B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER int32 Distance between two grid lines. Multiple of PointDistance.
GridColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Color of the grid lines.
MaxValue B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER float Maximal value this view can display. This value is used to scale the values in the history. If AutoScale is true this value is adjusted, if any value in the history exceeds this value. Otherwise any value greater that this value isn't displayed.
DataInfo B_COUNT_PROPERTIES B_DIRECT_SPECIFIER int32 Returns the number of data info objects.
B_DELETE_PROPERTY B_INDEX_SPECIFIER
B_REVERSE_INDEX_SPECIFIER
- Delete the data info object at "index".
any B_INDEX_SPECIFIER
B_REVERSE_INDEX_SPECIFIER
B_RANGE_SPECIFIER
B_REVERSE_RANGE_SPECIFIER
- Directs the scripting message to the specified data info object.

Every data info object supports the following scripting properties:

Name what Field Specifier Data Type Description
Color B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Color for the lines which are used to connect the values of the history of this data info object.
Scale B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER float Scale for this data info object. Before the values are displayed they are mutliplied by this value. Afterwards an additional scale is applied to transform the values to pixels. That second scale is calculated using MaxValue of the GraphView.
DataProvider B_GET_PROPERTY B_DIRECT_SPECIFIER IDataProvider * For internal use only.
Max B_GET_PROPERTY B_DIRECT_SPECIFIER float Maximal value. "Raw" data, not muliplied by scale.
Avg B_GET_PROPERTY B_DIRECT_SPECIFIER float Average value. "Raw" data, not muliplied by scale.
Current B_GET_PROPERTY B_DIRECT_SPECIFIER float Current value. "Raw" data, not muliplied by scale.

This example sets the color of the CPU Usage Graph's first data info (the CPU usage line) to red:

hey application/x-vnd.task_manager set Color of DataInfo 0 of View 2 of View 1 of View 0 of View 0 of View 0 of View 1 of Window 0 to 'rgb_color(255, 0, 0, 255)'

COverlayGraphView

An example for an object of this class is the graph view in the performance tab. If you select a data info object in the legend, it displays an overlay. That overlay contains the maximum, average and current value of the selected data info object.

This class is derived from CGraphView and supports all scripting properties of the base class and these additional properties:

Name what Field Specifier Data Type Description
TextColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Color of the text in the overlay.
TextBackgroundColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Background of the overlay. If you set the alpha component to a value less than 255, the overlay is displayed transludent.
BackgroundColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Background color for the whole view.
OverlayIndex B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER int32 Index of the "data info" object which is displayed in the overlay.

CLEDView

An object of this class is used in the "Usage" tab to display the current CPU usage. It displays single LEDs. Usually some of the lower leds are on, the upper ones are off. Under the LEDs a text is displayed.

Name what Field Specifier Data Type Description
LEDOnColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Color of LEDs which are on.
LEDOffColor B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER rgb_color Color of LEDs which are off.
LEDSize B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER float Vertical size of the LEDs.
MaxValue B_GET_PROPERTY
B_SET_PROPERTY
B_DIRECT_SPECIFIER float Maximum value of the data provider. Used to calculate which LEDs are lit and which aren't.
DataProvider B_GET_PROPERTY B_DIRECT_SPECIFIER IDataProvider * For internal use only.

How do I find a specific view?

To find a specific view inside a window you can use its "InternalName" property. Simply go through the views and take a look at their name.

The following example displays the name of the first tab view (which is "Usage"):

hey application/x-vnd.task_manager get InternalName of View 0 of View 0 of View 0 of View 1 of Window 0

Top  Top


© 2002 by Thomas Krammer