get absolute filename

How would I get the absolute filename of a selected file...I want to control click...I already have the context menu all set to run a script...I just need to be able to get the file name of the file I control clicked on.

In windows it is as follows:
set filename=%~f1
set name=%~n1
set extention=%%~xa

Then to call it %filename% or %name% or %extention%.

Is there the same thing for a Mac shell script?