Application Object Macros

An Application object macro is defined on the Application object's Macros page and can only be used with that Application object. The macro is simply a variable that has a value associated with it, as shown in the following two examples:

Variable Value

SOURCE_PATH

\\server1\sys\public\zen\word

TARGET_PATH

c:\program files\word

In the examples, SOURCE_PATH defines the network location from which Novell® Application LauncherTM/Explorer will distribute the application to the user's workstation, and TARGET_PATH defines the workstation location to which Application Launcher/Explorer will copy the files.

You can also create a macro that prompts the user to accept a default value you've assigned or to enter a different value. For example, you could use a macro that prompts the user with a default installation drive (such as C:) but lets the user change it to another drive (such as D:).

The following sections provide information about nesting other macros in Application object macros and instructions to help you define Application object macros:


Nesting Macros

When defining an Application object macro, you can embed other macros in the definition. In the following example, a special Windows macro, *WINDISK, is used when defining the TARGET_PATH macro:

%*WINDISK%\Program Files

Any time you use the TARGET_PATH macro in an Application object property field, Application Launcher/Explorer would substitute the current workstation's Windows drive letter for %*WINDISK% (for example, C:\TEMP).

When embedding another macro in the string, you must enclose the macro in % characters, as shown in the above example. You can embed special Windows macros, NDS attribute macros, environment variable macros, login script macros, and other Application object macros.


Defining an Application Object Macro

  1. In ConsoleOne, right-click the Application object for which you want to define the macro > click Properties.

  2. Click the Common tab > Macros to display the Macros page.

  3. To define a macro consisting of a variable name and a value (a String Value macro), continue with Defining a String Value (Non-Prompted) Macro .

    or

    To define a macro that prompts the user to accept a default value or enter a different value, skip to Defining a Prompted Macro .


Defining a String Value (Non-Prompted) Macro

  1. On the Macros page, click Add > String Value to display the Edit String Value dialog box.

  2. In the Value Name box, type a name for the macro variable (for example, TARGET_PATH). Do not use spaces in the name.

  3. In the Value Data box, type the value for the macro variable (for example, c:\program files\word).

  4. Click OK to add the macro to the Macros list.

For information about using the macro in a valid Application object property, see Application Object Properties Where Macros Can Be Used .


Defining a Prompted Macro

  1. On the Macros page, click Add > Prompted > Drive to create a macro that prompts the user for a drive or click String to create a macro that prompts the user for text input.

  2. Fill in the following fields:

    Macro Name: Enter any name that describes the macro. Do not use spaces in the name.

    Prompt Text: Enter the text you want presented to the user. For example, if you are prompting for an installation drive you could enter the following: "This application will be installed to your C: drive. Enter a different drive letter if desired."

    Default Value: For a prompted drive macro, select the drive that will be displayed as the default drive. For a prompted string macro, enter the text that will be displayed as the default text.

    Minimum Disk Space in MB: Enter the minimum amount of free disk space required. The user will not be allowed to install to any drive that does not meet the minimum disk space requirement.

    Maximum String Length in Chars (Prompted String Macro Only): Enter the maximum number of characters the user can enter as a response to a prompted string macro.

  3. Click OK to add the macro to the Macros list.

For information about using the macro in a valid Application object property, see Application Object Properties Where Macros Can Be Used .