【发布时间】:2019-04-29 12:14:37
【问题描述】:
我想使用 dxl 脚本在现有对象文本中添加剪贴板内容。
我四处搜索,包括 dxl_reference_manual 但没有任何帮助。
选择的对象有一些文本,例如“此对象中已经存在的文本”,剪贴板内容,例如“我的剪贴板文本”应该添加在开头并作为单个对象形成。
(输出应该类似于下面的单个对象。)
我的剪贴板文本 此对象中已存在文本
我的代码:
Skip fGetSelectedObjects(Module in_mod)
{
Skip skpObjects = create() // Return KEY and DATA both 'Object'
if (null in_mod) return(skpObjects)
Object oCurr = current,
o
for o in entire (in_mod) do
{ if (isSelected(o) or
o == oCurr) put(skpObjects, o, o)
}
return(skpObjects)
} // end fGetSelectedObjects()
Skip skpObjects = fGetSelectedObjects(current Module)
Object o
for o in skpObjects do
{ // deal with the selected o
string s = o."Object text"
// I don't know the way to activate the object text attribute instead of manual click. Thus it loops through selection and pastes the clipboard contents.
pasteToEditbox
//For Single Indentation use 360 points, double indentation 720 points and so on...
o."Object text" = richText (applyTextFormattingToParagraph(richText s,false,360,0))
}
delete(skpObjects)
【问题讨论】:
标签: ibm-doors