It should be possible to do this with Applescript, but the
perspective name property appears to be broken.
(On my system it invariably returns
missing value, even with windows freshly opened from the perspectives menu).
Code:
tell application id "com.omnigroup.omnifocus"
set oWin to front document window of front document
-- Always returns missing value
set str to perspective name of oWin
end tell