如何从 AppleScript 操作和打印 MS Excel 中的图表?
对于 MS Excel for Mac 2008 中的现有图表,在 AppleScript 中,我尝试做两件事:
- 将 3D 图表旋转 1°
- 将图表另存为图像 (png)
从我在 Intertubes 上找到的内容来看,似乎可能的。但 AppleScript 的尴尬冗长和网络上缺乏重要的 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://dietpizza.ch/images/ 3d-rotation-ms-excel-dialog-box.png
通过操纵此值,图表对象会发生如下两个图像所示的变化。 (15° 效果)
MS Excel 3D 图形示例 0 http://dietpizza.ch/图片/3d-rotation-0.png MS Excel 3D 图形示例 1 http://dietpizza.ch/images/3d-rotation- 1.png
With an existing chart in a MS Excel for Mac 2008, in AppleScript, I am trying to do two things:
- Rotate a 3D chart 1°
- Save the chart as a image (png)
From what I've found on the Intertubes, it seems possible. But AppleScript's awkward verbosity and the lack of non-trivial MS Excel AppleScript examples on the web are too much for me to overcome.
Just for the saving part, this is what I have so far:
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
The 'rotate 1°' task seems to involve "internal objects", but that is as far as I've gotten. By 'rotate', I mean to rotate the chart object itself, not the image. This can be done in with the Format Chart dialog box for ...
MS Excel Dialog Box http://dietpizza.ch/images/3d-rotation-ms-excel-dialog-box.png
By manipulating this value, it the chart object changes as in below these next two images. (15° for effect)
MS Excel 3D graph example 0 http://dietpizza.ch/images/3d-rotation-0.png
MS Excel 3D graph example 1 http://dietpizza.ch/images/3d-rotation-1.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过设置
图表对象
的chart
属性的rotation
属性,可以通过AppleScript更改图表的X轴旋转。下面的 AppleScript 应该可以解决这个问题:
The X axis rotation of the chart can be changed via AppleScript by setting the
rotation
property of thechart
property of thechart object
.The following AppleScript should do the trick: