How to add a contextual menu item to .psd files in Nautilus? The menu item would execute a script and pass it the path of the file.
Install nautilus-actions . This lets you add items to the context menu.
Open System>Preferences>Nautilus Actions Configuration.
You can define new menu items, and use conditions to ensure they only display for psd files.
This page has a decent walkthrough.
if you want Gnome-wide action on particular MIME type of file (within your login), you make right mouse click on one of those files icon in Nautilus, choose "Open with Other Application..." and in dialog popped up, make open edit window "Use a custom command" at bottom, type name of script (it should be executable, e.g. with chmod +x filename), and mark "Remember this application for "MIME type chosen" files" crossed.