AutoPlay Media Studio 9

DialogEx.EnumerateObjects

DialogEx.EnumerateObjects

This is the first topic This is the last topic  

DialogEx.EnumerateObjects

This is the first topic This is the last topic  

OverviewExamples

table DialogEx.EnumerateObjects (

)

Example 1

all_objects = DialogEx.EnumerateObjects( );

Gets the name of each object on the current dialog and stores them in a table called "all_objects."

Example 2

-- Get the names of all of the objects on the dialog.

object_names = DialogEx.EnumerateObjects();

 

-- Get the error code of the last action.

error = Application.GetLastError();

 

-- If an error occurred, display the error code message.

if (error ~= 0) then

   Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);

else

   -- If there are no objects on the current dialog, display a dialog.

   if (object_names == nil) then

       Dialog.Message("Notice", "There are no objects on the current dialog.", MB_OK, MB_ICONEXCLAMATION);

   else

       -- Display the names of all of the label objects on the dialog.

       output_string = "";

       for index, object in pairs(object_names) do

           -- Get the type of the object

           type = DialogEx.GetObjectType(object);

           if (type == OBJECT_LABEL) then

               output_string = output_string..object.."\r\n";

           end

       end

       Dialog.Message("Information", "Below are the names of all of the label objects on this dialog.\r\n\r\n"..output_string, MB_OK, MB_ICONINFORMATION)

   end

end

Gets the names of all of the objects on the current dialog and displays a dialog listing the names of only the label objects. If there are no objects on the dialog, or an error occurs, a notification dialog is displayed.

See also: Related Actions


Learn More: Indigo Rose Software - AutoPlay Media Studio - Buy Now - Contact Us