Oh dear!
Now I know why the first test script did work fine when I tried it: I ran it directly in the interactive console inside Fusion. When I run the same code by putting it in a script file and running it via the Script menu I get the same error as you did (the "attempt to index a string value" thing).
It seems the GetClipboard() is broken in the LuaJIT (I think Fusion is _always_ using the JustInTime compiler when it executes an external script but uses the "normal" interpreter when executing stuff interactively in the console).
Even a simple
- Code: Select all
comp:Copy(comp.ActiveTool)
dump(fusion:GetClipboard())
Gives the same error ("attempt to index a string value") when run as an external script, but works fine when executed directly in the console...