Xcode 4 lets you create custom behaviors that are performed from the Xcode > Behaviors menu, or are triggered by a keyboard shortcut. One of the actions that can be taken is the execution of an application or shell script.
What variables or arguments are passed to the script that it can make use of?
PWD
is another good one - the path where workspace/project is located – Hookup