grandMA3 User Manual Publication
Export(handle, string, string)

grandMA3 User Manual » Plugins » Lua Functions - Object API » Export(handle, string, string)
Version 2.0

Description

The Export object Lua function exports an object into an XML file.

Arguments

  • Handle:
    The function takes a handle of the type "light_userdata" as an argument. It can be omitted when using the colon notation on an object. See the examples below.
  • String:
    This is a string with the file path for the exported file.
  • String:
    This is a string containing the file name of the exported file.

Return

  • Boolean:
    The function returns a boolean indicating if the export was a success.

Examples

This example exports the selected sequence into an XML file:

Lua
return function()
--SelectedSequence() creates a handle to the selected sequence.
local selectedSequence = SelectedSequence()
if selectedSequence == nil then
ErrPrintf("The selected sequence could not be found.")
return
end
--The path is stored in a variable.
local exportPath = GetPath(Enums.PathType.UserSequences)
--The actual export function.
local success = selectedSequence:Export(exportPath, "mySelectedSequence.xml")
--Print some feedback.
if success then
Printf("The sequence is exported to: " .. exportPath)
else
ErrPrintf("The sequence could not be exported.")
end
end

 Related Object Functions

Import - object function used to import an XML table.