Author Topic: Script feature preprocessor directives  (Read 4409 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6427
    • View Profile
Script feature preprocessor directives
« on: 2010 May 18 10:41:11 »
If you want your script to be included in one of the next PixInsight versions —because you want, don't you?— I'd appreciate if you include the necessary feature preprocessor directives near the beginning of the script source code (or if the script consists of several source files, near the beginning of the file that must be launched). As you probably know already, these directives are:

#feature-id <script-menu-item>

This directive tells the PixInsight Core application where to put the script under the Script main menu item. <script-menu-item> is a sequence of one or more menu items separated with less than characters '>'. For example:

#feature-id Utilities > Magical Stuff > MyFooBarScript

would include the MyFooBarScript script under the Script > Utilities > Magical Stuff menu item. If a menu item doesn't exist it is created automatically. It's customary to build script names from joint capitalized words ("MyFooBarScript" instead of "My Foo Bar Script"), following PixInsight's usual naming style, although not mandatory.

#feature-info <script-information>

This directive is optional, but highly recommended. It is used to describe the script and provide extended information about how it works, reference material, author names, copyright notices, and in general anything related to the script that potential users should know. The information is only shown on the Feature Scripts dialog, but future versions of PixInsight will allow access to this information through dedicated options. <script-information> is an arbitrary string of UTF8 text. Use back slashes to divide a long description into several lines, if necessary. To force a line break in the printed text you can use standard <br> or <br/> tags. You can use also <b></b>, <u></u> and <i></i> tag pairs to specify bold, underline and italic font styles. You can use the whole set of Console tags and entities, including the whole set of ISO 8859-1 character entities. For example:

#feature-info  A foo bar utility.<br/>\
   <br/> \
   This script allows you to <i>foo bar</i> almost <u>anything</u>, as an option. \
   Keep in mind that if there is nothing like a foo, then you probably can't bar it, either.<br>\
   Copyright &copy; at any time, anywhere and anybody.

Note that white spaces at the beginning of each line are ignored. That's the reason why you see "as an option. \" above.

#feature-icon <icon-file-name>

If you feel creative, then you can create and assign an icon to your script. Otherwise, or if the icon you specify does not exist, a default one is used automatically. <icon-file-name> is a file path specification to the icon's file. If you don't include a directory path, the default is the same directory for the script's source code. This means that you actually shouldn't include a directory and put your icon along with your script, to avoid distribution problems. Supported formats are PNG and XPM. The icon's size must be exactly 24x24 pixels; if you use a different size the core application will resample it automatically, which not always produces a nice-looking result.
Juan Conejero
PixInsight Development Team