Resource Browser

KosmicTask Help

Resource Browser

The resource browser window displays resources associated with each of the scripting languages supported by KosmicTask. Each language separates its resources into two categories:

Application
Application resources are included as part of KosmicTask and cannot be modified by the user. The bundled resources include a range of script templates and informational documents for each of the supported scripting languages. A set of configurable language properties is also provided for each scripting language.
User
User resources are those created by the user for their own purposes. Users may create additional templates and documents for each of the supported scripting languages. These resources are saved in the /Users/My Username/Documents/KosmicTask/User Tasks/Resources folder.
Resource window templates
Resource sidebar
The sidebar provides an outline listing of all the resources available for each scripting language. The resource context menu is displayed on ctrl-click or right mouse click.
Resource tabs
The resource tabs provide access to the individual components of some resource types.
Resource editor
The resource editor allows the user to edit the selected resource. In the case of template resources the editor will provide syntax highlighting for the template script.
Resource menu
The resource menu offers the following options:
  • Add. Add a new resource of the current type.
  • Delete. Delete the selected resource.
  • Duplicate. Duplicate the selected resource.
  • Set Default. Mark the selected resource as the default for the selected scripting language.
Add resource
Add a new resource of the selected type.
Delete resource
Delete the selected resource.
Resource browser
The resource browser displays the selected sidebar item resources. To list all the available resources select the top level item in the sidebar outline.

Template Resources

A template serves as a starting point for a task in a particular scripting language. Each template is generally short and is intended to provide a basic piece of functionality. The same templates are available for each scripting language. If a template is not available for a given language it is because the language does not support the functionality outlined by the template.

When a new task is created the user is presented with a list of the available templates that matches the templates available in the resource browser window. Even though templates are complete in themselves it is usual to construct an individual task from selected fragments of different templates. This can be accomplished by dragging selected code sections from the resource browser into the task Edit Window.

Each scripting language has a default template that can be set using the resource context menu and is identified with a star. This item will be used as the template for all new tasks in the selected scripting language.

Each template consists of three elements each of which can be access via the resource tabs:

Script
The script element defines the actual template script. When defining user templates it is advisable to create a temporary test task and validate the template script before creating the actual template.
When a task is created from a template the template script is inserted into the task. Template scripts may contain tags that are replaced when then template is inserted into a task. The following tags may be used to identify the task creation author, date and script type:
  • {{ author }}. Insert the current username.
  • {% now | date_format: "dd MMM yyyy" %}. Insert the current date in the given format.
  • {{ script }}. Insert the script type.
The application templates all include these tags in the task comment block to help document the task.
Settings
Each template has a set of properties. Most of these are pre-set and cannot be modified but those which relate to how the task is run may be modified. The template settings are identical to the Settings Resources described below.
Info
The template info element displays a document resource that names, identifies and documents the template. The document fields are identical to those described below under Document Resources.

Document Resources

Resource window documents

A document resource provides documentation either for a scripting language or for an individual template. The resource provides the following fields:

  • Name. The resource name as displayed to the user.
  • Author. The resource author name.
  • Info. A short description that will appear in the resource browser.
  • Text. A free form description. The main body of the document.

Each scripting language includes a least two supporting documents:

Links
The links document contains a number of Internet links that identify key language resources.
Usage
The usage document contains an overview and samples of common scripting operations and application features. The features documented include function calling, result handling, file handling and Cocoa bridge topics. Most of the included code samples are available as templates.

The application supplied documents cannot be modified but the user can create new documents of their own to hold reference material for the selected scripting language.

Settings Resource

Resource window settings

A settings resource provides default language settings either for a scripting language or for a scripting template or for a task. Settings that are defined at the level of a scripting language act as default settings for all new tasks and templates created in that language. Settings defined at the level of a template are applied when the template is used to initialise a task. Template level settings override the default language level settings. Settings defined at the level of an individual task override all other settings. To set task level settings first open the task in an edit window, then select the Edit button and click the Settings tab.

Each of the supported scripting languages is implemented as a plug-in and the settings for each language define the features that are supported by the plug-in. Many of the language settings are read-only as they represent fixed properties of the language plug-in. Most language plug-ins however support a number of editable settings that can be used to modify how KosmicTask interacts with individual tasks.

When a settings resource is selected the resource editor displays an outline of the available settings. Each entry consists of a setting name and a value. Read only values are displayed against a grey background. Editable values have a white background. A collapsable panel below the settings outline provides information on each setting.