我正在尝试使用 LiveCode 来清理一些联系人数据。我有两个清单:
- SourceList:LiveCode 表字段中制表符分隔的联系人记录列表;
- FlagList:我想在 SourceList 中检查的字符串列表,例如“test”。
理想情况下,我想在 FlagList 行和 SourceList 行中的项目中突出显示“命中”,但我在第一次通过时遇到了错误。在从文件加载 SourceList 时,我试图设置在 SourceList 中找到的任何 FlagList 字段行的颜色。
这是“加载源列表”按钮上的脚本...
on mouseUp
answer file "Select text file to Clean" with type "txt"
if it <> "" then
put empty into field "Source"
put it into field "SourceFile"
put it into theFilePath
put URL ("file:" & theFilePath) into field "SourceList"
repeat for each line f in field "FlagList"
repeat for each line l in field "SourceList"
repeat for each item i in l
if i contains f then set the foregroundColor of f to "red"
end repeat
end repeat
end repeat
else
--no file was selected, or cancel was pressed
beep
end if
end mouseUp
我想我犯了一个基本错误,非常感谢任何指导。