title: Adding custom handlers with AppleScript to command bar controls in MS powerpoint 2011
body: <p>I have built a command bar using applescript like this.
  tell application "Microsoft PowerPoint"</p>
  
  <pre><code>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()"**
  </code></pre>
  
  <p>end tell</p>
  
  <p>on sayHello()
      display dialog "Hello"
  end sayHello</p>
  
  <p>I am not able to call subroutine "sayHello" on clicking of this control. I have added action but it is not called there. If anyone has solution to this problem as how to add or call any subroutine on clicking of command bar control.
  -Anirudh</p>