Pick Up Path of Folder for Macro - Pro Tools

If you don't mind, I will follow the course with you :slight_smile:

When I try this last applescript directly in KM and applied to an already saved text file, I get error too.

Why is this world so cruel ?

Thank you.

OK. Assuming you have used the correct process name and a project window was open, then this is bad news.

But in the result of Script editor.app, I get:

"file:///Users/Me/Desktop/a%CC%80%20jeter/code-in-cache-page.txt"
(with this text file of course)

According to the error message you have an incompatible ScriptingAddition installed. Try to update it.

A very similar problem is troubleshooted in the posts here.

Appreciate you trying!

It’s not the same if you launch a script with osascript (which is what KM uses) or with Script Editor. Apparently Script Editor is more tolerant.

But this is not related to the Pro Tools thingy. Not every app responds to the accessibility attributes like "AXDocument". See the topic which you have linked to.

@rpalagy, let’s hope there are Pro Tools users on the forum who can help you.

Tom, you were right! KM macro works now like a charm. Not with Photoshop so far (what I was looking for).
Thank you.
The QXP extension is from Quark XPress and the app is deinstalled.

Then I would delete it. You should find it in one of these folders.

Oh, yes. I forgot to write that I did remove it of course, else it wouldn’t work.

For fully scriptable apps you don’t need GUI/accessibility scripting.

In TextEdit you can get the document path with this:

tell application "TextEdit"
  path of document 1
end tell

In Photoshop (CS6):

tell application "Adobe Photoshop CS6"
  file path of document 1
end tell

Excellent ! Thxs !

To find out if an app is scriptable open Script Editor > File > Open Dictionary… and look for your app in the list.

If you choose an app from that list you will see the contents of its scripting dictionary: which elements are available and how to use them. Some things are common for many apps, other things are specific for that app.

If your app is not in the list, then you likely have to resort to GUI/accessibility scripting (the ugly stuff with group 1, text area 1, AXDocument, etc.). GUI scripting is much more limited than “real” scripting and pretty clunky.

Especially if your app is built with a cross-platform framework, or is a cheap port from another platform, chances are good that GUI scripting will fail.

So Pro Tools is not available in the Script Editor’s Dictionary…was hoping to maybe cmd-click on window, arrow down and have it take me to the folder whose path I want. I can then “get Info”. Next I “see” the path but how to get Km to copy that path. Is there a way to reveal the path of a selected Finder window and insert that as a variable into KM?

When I am doing bounces it's usually because I want to send them somewhere.
What I do for bounces is this:

Create a folder on the Desktop called Bounces. If there are other "B" items I'd use a different name or sort the folder to the top using numbers in the beginning of the filename.

In my case I don't ever put a folder on the desktop of my Pro Tools rig with the letter "B". Also there's no internet connection to the Pro Tools rig however AppleTalk will work on a local network when the network jack on the mac is disabled so my folder is actually an alias to an iMac's desktop in the studio that actually does have an internet connection where I send mail from.

When I get to the "Save" dialogue box I use the keyboard shortcut COMMAND+D to move straight to the desktop then hit the letter "B" which would take me to the first folder or item starting with "B".

You could create macros to handle this or similar workflows to solve the puzzle.
So my suggestion to get to where you want to go is: What can you script or create an action to speed up the process?

If you don't want to spend the time figuring it out, check out the macro library for copy, move, filing scripts others have made that you can adapt.

Another possibility: At the start of creating your session could you create an alias of the bounce folder contained within your current projects folder, (You could use one of the "select" item actions many have posted here which wouldn't be dependent on Pro Tools), and put it in one of the paths OS X uses as defaults for keyboard shortcuts. (You could also create a macro for this). When I say "default" folder shortcuts I am referring to these:

Maybe you can't script Pro Tools but you can script the Finder. You could also use Hazel as an alternative.

John these are good ideas. I think my workflow is a little different
because I’m always in the middle of about 6-10 projects per day - always
changing and I’m always exporting to the Bounced Files folder of the
respective session I’m working on so I’d have to make 6-10 aliases per day.

I feel like there’s got to be an automated way to “pick up the path” so to
speak of my session with a keystroke and then have macro that navigates to
it.

Since Pro Tools doesn't seem to support scripting, and the other suggestions have not worked for you, I'll throw out this idea.

Instead of opening your Pro Tools project directly, use a KM Macro/script to open it. In the process it can set a KM Var to the project path, and then use later (in another Macro) as needed.

I think that's your answer right there.

There's got to be a way to initiate the macro and have it watch for a new Audio folder to be created then it could drop the path into a variable and actually simultaneously create the 'Bounces' folder in the session "Audio Files" folder and simultanously create the alias in the Bounces folder on the desktop. Unless you don't care about having a desktop folder with all the aliases you can access from the desktop.

Just keep asking questions and keep thinking about it. Someone here will offer something that works or you'll realize how to do it and be able to ask someone here to get you started.

Pro Tools really ticks me off. It's why I am learning Studio One concurrently.

Ok, I am just thinking about this and starting to get some more ideas. Are you using the Workspace window?

John and JMichael thanks for these ideas. Opening and closing PT doesn’t work for me. I switch between 6-10 active projects throughout the day…no way do I have time to quit Pro Tools. I’m also constantly opening existing sessions to make mix revisions, fixes and additions. Creating a new folder or having lots of folders on the desktop is not the answer. Need a way to copy the path of whatever active session I’m in as a variable into a clipboard. I’ve gotten to the point where I can use KM to CMD-click on top border of active PT Edit window and navigate down to finder and click get info. Now I just need an automated way of copying the path that’s displayed in “Get Info” from the Finder.

actually just found my answer I think!

found this forum entry:

Now just have to figure out how to take the clipboard which has the path and use it to navigate to the folder!