Tag: 苹果脚本

AppleScript和Excel 2008数据透视表

创build自动化脚本将Excel列移动到数据透视表时遇到了很多麻烦。 我在OSX 10.8.5上运行没有VB的Excel 2008。 最终目标是将列数据字段转换为行数据字段。 tell application "Microsoft Excel" open file "Users:dkstaff:Desktop:new.xlsx" tell active sheet tell used range set rc to count of rows end tell set myRange to range ("D2:D" & rc) set formula of myRange to "=A2&\":\"&B2&\":\"&C2" # select sourceData insert into range column 4 set header to range "D1" set value of […]

将Excel工作表保存为HTML

我试图将工作簿( foo , bar , baz )中的每个工作表保存为一个单独的HTML文档( foo.html , bar.html , baz.html ): set theDirectory to (path to desktop as text) & "Output:" set theSource to choose file with prompt "Choose file:" default location "/Users/<user>/Desktop/" of type {"XLS", "XLSX"} tell application "Microsoft Excel" activate set theWorkbook to open theSource set theSheets to every sheet of […]

未findAppleScript本地variables

我有这个已经工作了多年的AppleScript: — excerpted portion of larger script tell application "Microsoft Excel" set jfFileName to "My Finances " & yearChoice & ".xls" try set theWorkbook to workbook jfFileName on error display dialog "Sorry, Excel doesn't seem to have the file '" & jfFileName & "' open. Please open it, and run again." buttons {"OK"} default button […]