-- function getModuleInfo() -- module properties local props = { -- module name name = "ClipboardExport", -- module author(s) author = "various", --module version version = "0.1", -- interface implemented by this module implements = "PluginInterface", -- plugin functions exposed by this module????? functions = { "getPluginInfo:l:", "exportToClipboard:i:o@db.Catalog", } } return props end function objectPluginInput(type) return grtV.newObj("app.PluginObjectInput", {objectStructName = type}) end function getPluginInfo() -- list of plugins this module exposes (list object of type app.Plugin?) local l = grtV.newList("object", "app.Plugin") -- plugin instances local plugin plugin = createNewPlugin("wb.catalog.util.exportToClipboard", "Test Export: Copy Test String to Clipboard", "ClipboardExport", "exportToClipboard", {objectPluginInput("db.Catalog")}, {"Catalog/Utilities", "Menu/Catalog"}) -- insert into (append to?) list of plugins grtV.insert(l, plugin) return l end function createNewPlugin(name, caption, moduleName, moduleFunctionName, inputValues, groups) -- create dictionary, Lua seems to handle keys and values right... local props = { name = name, caption = caption, moduleName = moduleName, pluginType = "normal", moduleFunctionName = moduleFunctionName, inputValues = inputValues, rating = 100, showProgress = 0, groups = groups } local plugin = grtV.newObj("app.Plugin", props) -- set owner??? plugin.inputValues[1].owner = plugin return plugin end -- ############################ -- ## change from here ## -- ############################ -- -- export function function exportToClipboard(catalog) -- on XP I get half the length of the exported string in garbage characters... Workbench:copyToClipboard("abcdefghijklmnopqrstuvwxyz0123456789") -- OUCH! this string produces a runtime exception! --Workbench:copyToClipboard("abcdefghijklmnopqrstuvwxyz0123456789!§$%&/()=") print('\n > Copied to clipboard.') return 0 end