Promptu Launcher - Rocket Your Productivity

Home Help Feedback About Download

What is a function?

A function enables you to call and get results from external .NET code

Writing external .NET functions

See documentation on writing functions

Invoking functions from the prompt

Functions may be invoked from the prompt. If they return a non-null value, a message box is opened displaying the result.

There are two ways they may be invoked:

  1. Normal function-call syntax (nested calls allowed):

    function()
    function("value", "value")
    function(otherFunction())
  2. Command-invocation-like syntax (nested calls not allowed):

    function
    function value value
    function "value" "value"

Function configuration

Name

The name is what you want to call your function. It is recommended that you give your functions meaningful names. Names can also contain namespaces.

Naming rules:

The first character can only be a letter or an underscore ('_').
The rest of the characters can be letters, digits, or underscores ('_').
Any character between the first and the last can also be a period ('.').

Examples:

DateTime.Now.ToString
Enviroment.GetMyDocumentsPath
PadString

Assembly

The name of the assembly reference that points to the assembly containing the function.

Class

The fully-qualified type name (namespace + class name) of the instance class which has a parameterless constructor and contains the function.

Examples:

Promptu.CommonFunctions
This.Is.My.Namespace.FunctionsClass

Method

The name of the method (function).

Examples:

GetMyDocumentsPath
CreateDirectoryIfDoesNotExist

Return

The type the function returns. It may be String, String[], or ZachJohnson.Promptu.UserModel.ValueList.

Parameters

This is where you configure the parameters.

  • Suggestion mode

    Suggestion modes may be configured (if the selected mode allows configuration) by clicking the button to the right of the Suggestion Mode column.
    • None: Do not provide any suggestions for the parameter, except history if "Show History" is checked.

    • File system: Use Promptu's powerful directory navigation feature from within the parameter, with the option to specify a filter for the files shown.

      You can separate multiple filters using the "|" character.
      If you would like a filer to not show files that match it, place a "!" at its beginning. You can use a "!" by itself to hide all files (and only show folders).

    • Value list: Select a value list you want suggested for the parameter.

    • Function return value: Allow a function to generate a String[] or ValueList to use in suggesting for the parameter. The configurable ITL expression indicates which function to use.

      You may use ITL substitutions in the expression to capture the value of previous parameters.

  • Show history

    Indicates whether to show history for the parameter.