Which version of Geany are you using? Inside current svn version it should be possible by combining %d and %f in a good way. But this has been introduced after 0.18 so not yet available inside a stable release.
If you are running 0.18 or below I'd suggest to use a make file and set up a special target for your action so you could call it by make some_fancy_action or by using the make custom target menu item.
I'm running the last stable version: 0.18. I'm glad that the current svn version introduce %d (the directory I suppose). I think that the solution with a make file doesen't work for my problem: I need the full filename in order to pass it to the run command of my Xml project. This command validates the current file. So it can be anywhere on the disk, not specially in the working directory of the project.
One again, many thanks for this very nice ide. Didier