以下脚本在 AppleScript 编辑器中运行时以文本形式返回页面上对象的自选图形类型。但是,当从 PowerPoint 中的 applescript 菜单运行时,它会返回一个脚本常量。
我正在使用一个更复杂的版本来根据对象的自动形状类型将对象的属性发送到不同的应用程序......表格放在一个地方,占位符另一个,矩形等到第三个。我也在 PPT 中启动它以推出数据,并且不能真正从任何其他应用程序中提取它,因此 AppleScript 菜单将是我想要的位置。
谁能告诉我为什么同一个脚本会给出两个结果?
谢谢,亚历克斯
tell application "Microsoft PowerPoint"
set currentSlideNumber to slide index of slide range of selection of document window 1
set theSlide to slide currentSlideNumber of active presentation
end tell
getProperty(theSlide)
to getProperty(theSlide)
tell application "Microsoft PowerPoint"
repeat with thisShape in (get every shape of theSlide)
set shapeType to shape type of thisShape
set shapeContent to content of text range of text frame of thisShape
display alert (shapeType as string)
end repeat
end tell
结束 getProperty