Finder & Path Finder

Why this work in finder but not in Path finder. I want get path to a selected file in Pathfinder (and finder)



on run {input, parameters}
	tell application "Path Finder"
		set ruta to (POSIX path of the (selection as alias))
	end tell
	return ruta
end run


Some help? thanks

Would be great do something like that…

If file is selected in finder do this
bla bla bla
if file is selected in pathfinder do this
ble ble ble

return string path of file selected to work with shell script…

i can achieve this “path to selected file” directly in shell script if i have file selected in pathfinder… ?