First off let me appologize, it seems as though I have taken over the forum with all my posts. I truely do look for solutions before posting here (Google + Forum search tool + Wiki + API documentation), but being that this isn't the most common programming language, and it revolves around a MMO's API the available info is limited (espeically compared to straight up c# (my bread and butter)). I really appreciate all the help, you guys/gals are fantastic!
Ok, so I found this nifty little thread
here with some code on how to copy text to the clipboard. When I run the code, it tells me an addon is trying to make an illegal call to [CopyAllTextToClipboard]. Being that there are addons here that do exactly that, there must be something I'm missing. Any help would be greatly appreciated.
Here is the code that uses it, so when I open up my inbox I get the error (starting at line 12). Right now I'm just trying to get it to copy "Hello World" to the clipboard:
Lua Code:
function CopyMailStuff.ReadableMail(eventCode, mailId)
AttachmentsString = ""
local mail = {}
mail.senderDisplayName, mail.senderCharacterName, mail.subject, mail.icon, mail.unread, mail.fromSystem, mail.fromCustomerService,
mail.returned, mail.numAttachments, mail.attachedMoney, mail.codAmount, mail.expiresInDays, mail.secsSinceReceived = GetMailItemInfo(mailId)
if mail.numAttachments > 0 then
local intAttachmentCounter = 1
local intNumberOfAttachments = mail.numAttachments
AttachmentsString = mailId .. "<,|,>" .. mail.senderDisplayName .. "<,|,>" .. mail.subject ..
clipBoardControl = WINDOW_MANAGER:CreateControl("Chat2ClipboardControl", GuiRoot, CT_EDITBOX)
clipBoardControl:SetHidden(true)
clipBoardControl:SetMaxInputChars(1000)
clipBoardControl:SetText("Hello World")
clipBoardControl:CopyAllTextToClipboard()
end
end