I've read your post several times and I'm trying to understand the question. In your situation is your code the sole "user" of the apps or is there also a human user doing things to the apps that might change what your code is supposed to do? And does the solution have to avoid interfering with the human's work?
If your code is the exclusive user of the apps, then I imagine it's just a case of remembering the path that was sent to each app when you opened the file. but if the question is "what file is the human user working on right now" that might be tricky. That might depend on using AppleScript to avoid interfering with the user, and some apps aren't AppleScript friendly so that could be a problem.
I could be totally walking down the wrong path here. I'm trying to understand what you want to "capture". The name of the file a human is editing? What if the human is editing multiple files at the same time? So many questions.
Awesome knowledge JM. A significant number of user problems require AppleScript to solve. This was probably one of them, assuming that there's a human user involved in this situation, and that's probably a valid assumption.
it works perfectly even with multiple tabs, and I added the script to my Pages and Numbers Palettes.
thank you very much.
I often work in Scrivener I don't know if you are familiar. A Scrivener file is called a project and it contains multiple documents.
I can capture the document name no problem, but I can't capture the project UNIX. Would you have any idea of how to do so ? If not @gglick perhaps has an idea.
Well that's definitely true, but you need to actually read the dictionary of an app to figure out what syntax it needs for a given task.
After that you need to actually test to see if you can make what the dictionary says work in real life. That sometimes is not as easy as it should be and may take some research on the net to discover how the syntax actually works.
Not all apps use the same syntax for similar objects and operations (unfortunately), and there are inconstancies even amongst Apple's own apps (shamefully).
This is Script Debugger 5's Dictionary Window on OSX 10.14.6. (Script Debugger 8.0.3 is the most up-to-date version, but I have reasons to use SD5 still on this machine.) Note that it makes discerning object hierarchies relatively simple.
At $100, Script Debugger is very pricey for this kind of playing around. If I had an employer to reimburse me for all the productivity it would provide, that would be different. Does the Lite mode do all this? I have a hard time telling from the web pages that are encouraging me to buy it.