Using applescript with Calendar in El Capitan
Code does not work as is. I have tested this and it works.

tell application "Apple Configurator 2"
activate
delay 30
tell application "System Events"
    keystroke "a" using {command down}
    delay 5
    click menu item "1 - Erase" of menu 1 of menu item "Apply" of menu 1 of menu bar item "Actions" of menu bar 1
    delay 5
    click button "Apply" of sheet 1 of window "All Devices"
end tell
end tell