[Command] Paste string coming from outside in a script

Hello, this is my first question, and of course really love how cool is Aseprite supporting scripts.

What I want to do is to paste an hex string like #33ff44ff and set the foreground color with the chosen one.

I have tried to use app.command.Paste() and app.command.PasteText()

local colortext =app.command.Paste()

app.alert(tostring(colortext))

but in the alert appears command: and the number of the command, but I cannot paste the value.

Is this possible? I think it would be great for scripting.

Thank you!