0

我已经使用这样的applescript构建了一个命令栏。告诉应用程序“Microsoft PowerPoint”

make new command bar with properties {bar type:menubar command bar, bar position:bar floating, name:"Ani Tech", built in:true, entry_index:1, row index:0, embedded:false, embeddable:false, top:300, protection:no protection, width:1000, height:500, id:1}
make new command bar control in command bar "Ani Tech" with properties {control type:control button, entry_index:0, begin group:true, button style:button caption, name:"Create MCQ", face id:1}
set btnAbout to make new command bar control in command bar "Turning Tech" with properties {control type:control button, entry_index:1, begin group:false, button style:button caption, name:"Save MCQ", face id:2}
make new command bar control in command bar "Ani Tech" with properties {control type:button icon, entry_index:2, begin group:false, button style:button icon, name:"Tool", face id:0}
**set onaction of btnAbout to "sayHello()"**

结束告诉

在 sayHello() 显示对话框“Hello”结束 sayHello

单击此控件时,我无法调用子例程“sayHello”。我添加了动作,但没有在那里调用。如果有人对此问题有解决方案,例如如何在单击命令栏控件时添加或调用任何子程序。-阿尼鲁德

4

1 回答 1

0

You need to use the "my" prefix to call your script's handlers from within a tell block.

my sayHello()

(see relevant passage of the AppleScript Language Guide)

于 2012-04-06T13:47:00.157 回答