0

我正在尝试自学 AppleScript 一些我真正需要 AppleScript 的东西。

(我知道重复的东西必须有捷径,但我找不到关于如何做到这一点的好教程,所以我做了很长的路要走。)

我被困在如何一次选择多个列(或行)上。我想选择填充的列并对它们进行排序,但我不能,因为我不知道如何选择多个列。任何指导将不胜感激。

我希望脚本做的是:

  • 打开一个 Excel 文件
  • 删除第 1-32 行
  • 删除第 4-7 列
  • 删除新列 7
  • 选择第 1-5 列
  • 对第 1-5 列进行排序,首先按任务,其次按样本
  • 删除包含ENDO的行
  • 保存存档

这是我到目前为止所拥有的:

tell application "Microsoft Excel"
activate
open (choose file)
end tell

tell application "Microsoft Excel"
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete row 1
    delete column 4
    delete column 4
    delete column 4
    delete column 4
    delete column 7
    select row 1
    select row 2
end tell
4

1 回答 1

2

这应该可以帮助您入门:Excel 2004 AppleScript 参考

tell application "Microsoft Excel"
    tell active sheet of active workbook
        set myRows to range "1:27"
        delete myRows
        set myColumn to range "D:G"
        delete myColumn
    end tell
end tell
于 2013-01-08T23:06:20.957 回答