How can I create a custom button from copied python text of completed actions such as selecting multiple objects? In Maya, a while ago, I had a character rig with many grips that I needed to select for one action, like keying, or moving the object. I opened the python script window, then I began selecting all of the grips I wanted. I copied the script that was created after selecting each grip. Then I copied it into the script editor and created a custom shelf button. Now I had a button that allowed me to select about 20-30 grips, and move, or key them all at once. (The button selected them all.) 

In blender I have been trying to figure this out. I have a simple hand rig. I need to constantly move the hand, and key it in. In order to do this, I must select all visible grips, pan out of camera view in order to find the ones off screen, select them, then move the hand, and key in each grip by selecting them individually, and pressing I followed by O.

I was wondering if there is a way for me to create a button that would select all 6 grips on the hand, and that's it. This way I could select them by pressing the custom button, saving me tons of time. Also if there was a way to create another button that would select, and key all six grips as well. I had one of those in Maya. Just wondering if Blender had any similar capabilities.
In blender actions are performed by operators. We can use python to create custom operators that perform (almost?) any custom task that we want. An operator can be run by attaching it to a keyboard shortcut, a button within the UI or by searching for the operator by name in the search menu available by pressing space.

Different parts of blender's interface are separated into panels - which are the UI blocks that can be expanded/collapsed. We can create custom panels to display what we want and specify where we want the panel to be displayed, such as object properties, 3DView toolshelf or properties region...

By defining a custom operator and/or a custom panel you can customize any task as well as provide a custom interface to access the tasks. While you can run a python script to add these it is usually preferred to create an addon that defines each component which can be cleanly enabled and disabled. There is a tutorial in blender's python API docs on creating an addon as well as example templates within blender's text editor.

It is also common to create a custom panel that is specific to a rig, often buttons are used to show/hide parts of the rig as well as control IK/FK etc. One example is the rigify addon included with blender, it creates the following panels for the generated rig, as it is specific to the rig it uses a script that gets run when the blend file containing the rig is opened.