I acknowledge that you are fine with a different solution, but it may be of interest for other readers who are working without PathFinder:
Still referring to @ccstone’s macro, it works for me also with two projects open in tabs, like this:
“Untitled 2” and “Untitled” are projects. When I run the macro it returns the POSIX path of the active tab (project).