Export(handle, string, string)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object API » Export(handle, string, string) Version 2.2

説明

Export 関数は、オブジェクトをXMLファイルにエクスポートします。

引数

  • handle:
    light_userdata 型のハンドルです。オブジェクトでコロン記法を用いる場合は省略できます。
  • string:
    エクスポートされるファイルのパスを含む文字列です。
  • string:
    エクスポートされるファイル名を含む文字列です。

戻り値

  • boolean:
    エクスポートが成功したかどうかを示す boolean 値を返します。

選択したシーケンスをXMLファイルにエクスポートします。

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

関連するオブジェクト関数

Import - XMLテーブルをインポートするためのオブジェクト関数。