In this particular case, I was trying to get the name of the currently open Logic session, which I ended up just getting from the window title; didn't need the path after all.
Tried using @ccstone's macro again today to help with this, with no joy. Of course, I didn't bother to read the macro notes this time, hence my pointless assertions.