Share

OptionItem

[Slices][Desktop Automation]

Properties

Back to top

The properties of the slice operation to perform extend the SliceInput object.

Property Read/write Type Description
identifier read String Returns identifier of the option
type read String Returns the type of the option. Can be 'integer', 'double', 'choice', 'string', 'boolean' or 'group'.
caption read String Returns caption of the option
value read/write String/Integer/Float Returns value of the option. Type depends on the type of the option.
min read Integer/Float Returns minimum value of the option. Type depends on the type of the option. Requires type integer or double.
max read Integer/Float Returns maximum value of the option. Type depends on the type of the option. Requires type integer or double.
count read Integer/Float Returns count of choice values of the option. Type depends on the type of the option. Requires type choice.

Back to top

Methods

Name Syntax Description
getchoicekey option:getchoicekey(index:Number) Returns key of choice value for given index
getchoicedescription option:getchoicedescription(index:Number) Returns description of choice value for given index as it appears in UI

Back to top

Example

List available OptionItems of an example input

mysliceinput = system:createsliceinput("SLICEFILETYPE_OFFSET");
message = "Available OptionItems of " .. mysliceinput.slice_type .. "\n";
for i = 0, mysliceinput.count-1, 1 do
    option = mysliceinput:getoption(i);
    message = message .. "- " .. option.caption .. " (" .. option.identifier .. ") of type " .. option.type .. "\n";
    if option.type == 'choice' then
        for i = 0, option.count-1, 1 do
            message = message .. " (" .. i .. ") " .. option:getchoicedescription(i) .. "\n";
        end;
    end;
end;  
system:messagedlg(message);

Result:

Available OptionItems of SLICEFILETYPE_OFFSET
- Offset (offset) of type double
- Roundness (roundness) of type double
- Tag mapping (slicetagmapping) of type string

Back to top

Was this information helpful?