Get Open File's Name

Hey Guys,

Is there a way to get name of a file you have open in an application without the actual window title?

For example I have a Pro Tools session open named CAS211m09, but the front window automatically is titled: Edit: CAS211m09, and I want to create a variable with the Filename (or at least the window name without "Edit:).

How could I go about doing that and then storing it as a variable?

Have you seen the huge Pro Tools thread? Especially this post, where @Fokke seemed to have success with an Accessibility AppleScript.
The macros are posted in the follow-up posts.

If the above solution doesn’t work, then try this approach. It seems to work for Audacity (also a hardly scriptable app), by getting the file name from the Recents menu.

See this macro by @ccstone:

MACRO: Finding the File Path for the Front Document in the Front Application

Tom I hadn’t seen it! Thanks so much for thinking of me.

Best,

Ray