In my previous
post, I introduced companion scripts and some new macros for working with command-line probes.
There is one other interesting features of the sample probes I supplied; the means of displaying values from the companion scripts in the <command-display> section of the probes.
Here is the <command-display> section from our python example:
<command-display>
\b5\Companion Script Return Values\p0\
\4\ Value1:\0\ $val1
\4\ Value2:\0\ $val2
</command-display>
How do $val1 and $val2 get set?
By default, all output from a script called by a command-line probe is displayed as the "reason" or "condition" of the probe. However, our python example creates output in a special format:
print "\{ $val1 := 1, $val2 := 'abcdef' }Condition string - device should be yellow"
Within the specially-escaped brackets, we set values for variables that will then be available for the probe to display. Everything after the brackets is treated as the "reason" or "condition" of the probe.
You need to be a member of iMapper Community to add comments!
Join iMapper Community