以下脚本在AppleScript编辑器中运行时,将以页面上的对象的自动类型形式返回文本。但是,从PowerPoint内的AppleScript菜单运行时,它将返回一个脚本常量。PowerPoint AppleScript菜单给出与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
不幸的是,无论对象的形状类型如表格,矩形,文本框还是梯形,PPT调用的脚本都会在警报中显示“constant ****å”。你的脚本是否有效?当我试图保存它时,除非我添加引号,否则它不会编译<>。 –
inaneAlex
这只是一个例子来向你展示这个想法。 <>和<>是您需要放置常量的位置。我实际上没有尝试一个脚本。这个想法很重要。然后你接受这个想法并使其工作。您需要查看Powerpoint的applescript字典以查找可能的形状类型。 –
regulus6633