Create a custom menu with the submenu Save/Send Records As... removed.
Add back either of the other two Save Records (if you need them) as commands [Excel or Snapshot] attaching a script to them to perform the same action.
With the custom menu in effect, even if the user has the toolbar displayed and it includes the Save as PDF button, the button is dimmed and will not work since the command does not exist in the Menu.
Thank you for your answer!
The first part worked perfectly. Thank you!
But: I've been somewhat unclear. I don't want the button dimmed. I want the button to execute my script. Is there a way to do that?
As soon as I add an Action and indicate my script, the button dims. Regardless of whether I have the "Based on" option active or not.
Unfortunately, I don't believe there is a way to do what you would like [other than creating your own look-alike "toolbar"].
The toolbar buttons are not scriptable to my knowledge. I have always 'wished' you could make your own toolbar buttons or change the function of them, but so far that is not in the list of features.
Oh. I was under the impression that the toolbar buttons worked the same way as Custom Menus, meaning that you can just replace the standard action with your scripted one transparently in the background, without the user noticing anything. I thought it was just a question of getting the right menu to replace.
Thank you anyway for answering!
The issue with doing this in Custom Menus is that some of the Custom Menus are locked -- not editable. You can disable locked menus or delete them in a Custom Menu, but you can't reprogram them.