autohotkey - 如何将大量数据复制到剪贴板
问题描述
我有一个数组 [1, 2, 56, 32, 54] 或其他东西。
我如何将其发送到剪贴板
1 2 56 32 54
我试过这个。
Loop % table.MaxIndex() {
meow := table[A_Index]
Clipboard := meow"`r"
}
解决方案
table := [1,2,3,4,5,6,7,8,9]
vClipboard := ClipboardAll
Clipboard := ""
Loop, % table.Count()
string := string ? string . ", " . table[A_Index] : table[A_Index]
Clipboard := string
;Do some stuff.
Clipboard := vClipboard ;Restore the Clipboard.
您的问题是尝试使用 table.MaxIndex() 进行循环,这可能会给您带来意想不到的数量,因为您可以拥有一个包含 2 个值但在索引方面相距甚远的数组,即
table := [1]
table[93] := "String"
而且每个循环都在覆盖你的喵值。您要使用的方法是连接,即
meow := "Hello"
meow := meow . "World" or meow .= "World"
推荐阅读
- java - 使用 ObjectBox 存储一对多关系列表?
- python - 为什么自适应阈值图像小于原始图像?
- azure-devops - Azure DevOps 看板
- javascript - 对象标签数据属性与 iframe src 和表单提交
- javascript - 如何让确认框与 jsp 一起使用?
- mysql - 需要一个更新查询来根据目标表的列将分数从参考表更新到目标表
- java - 我的 java“文件字数统计”程序不准确
- haskell - 我很困惑为什么这种合并排序的实现不起作用?
- javascript - 将表单输入值转换为 JSON
- python-3.x - 从 Trakt.tv Watchlist 获取数据的非常简单的“随机电影 Windows 应用程序”