在AppleScript中如何检索当前活动工作表的名称?

这似乎是一个简单的问题,但谷歌的使用还没有得出答案。

考虑下面的代码…

tell application "Microsoft Excel" set strActiveWorkSheet to active sheet of active workbook display dialog strActiveWorkSheet end tell 

此代码不起作用。 看起来,set命令将strActiveWorkSheet设置为表示活动工作表的对象。

也许我在这里错了,但问题仍然存在…

如何检索当前活动Excel工作表的名称?

有趣…你的问题是答案…只是得到它的名字。 你是对的。 你有一个对象的方式,其书面和对象具有属性,其中之一是“名称”。 换句话说,改变这一行…

 set strActiveWorkSheet to name of active sheet of active workbook 

要查看对象的所有属性,请尝试…

 tell application "Microsoft Excel" return properties of active sheet of active workbook end tell 

你可以通过请求访问任何这些属性。 祝你好运。