--多选复制
require "import"
local tl,t1=service.getAllTextList(),{}
for i=0,#tl-1
table.insert(t1,tl[i])
end
local t2={}

local dlg=LuaDialog()
.setTitle("依次选取")
.setMultiChoiceItems(t1,t2)
.setButton("确定",function()
service.copy(table.concat(t2))
end)

.show()
dlg.onItemClick=function(l,v,p,i)
t=v.text
te=table.find(t2,t)
if not te
table.insert(t2,t)
else
table.remove(t2,te)
end
end

dlg.onItemLongClick=function(l,v,p,i)
end