The following article explains how shortcuts can be created programatically:
Creating and Modifying Shortcuts