Tag: osx mavericks

将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 […]

Excel无法打开Python生成的CSV文件

我有很多输出CSV文件的Python脚本。 在Excel中打开这些文件有时很方便。 安装OS X Mavericks之后,Excel将不再正确打开这些文件:Excel不会parsing文件,而是复制文件的行直到内存不足。 特别是,当Excel试图打开该文件时,出现提示读取:“文件未加载完全。 我用来生成CSV文件的代码示例: import csv with open('csv_test.csv', 'wb') as f: writer = csv.writer(f) writer.writerow([1,2,3]) writer.writerow([4,5,6]) 即使上述代码生成的简单文件也无法在Excel中加载。 但是,如果我在文本编辑器中打开CSV文件并将文本复制/粘贴到Excel中,请将文本parsing为列,然后从Excel保存为CSV,然后可以在Excel中重新打开CSV文件而不会出现问题。 我是否需要在脚本中传递一个额外的参数来使Excel以与之前相同的方式parsingCSV文件? 或者有什么设置可以在OS X Mavericks或Excel中更改? 谢谢。