Pick Up Path of Folder for Macro - Pro Tools

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!

So when I'm in Pro Tools and have the export window open

how do I use the path in my clipboard to navigate to a folder?

Once I"m in this window, all menu options in Pro Tools are greyed out and there is no option to use my clipboard and paste it or navigate to it.

I think it’s SHIFT-CMD-G!

Still struggling…so far I have

Move and Click at (1000,30) from the Top Left Corner of the Main Screen
Type the Down Arrow Keystroke
Type the Return Keystroke
Execute AppleScript
Display Text ‘%FinderInsertionLocation%’ Briefly
Reveal File ‘%FinderInsertionLocation%/Bounced Files’
Set Variable ‘To Clipboard’ to Text ‘’
For Each Item in a Collection Execute Actions
If All Conditions Met Execute Actions
Set Clipboard to Text ‘%Variable%To Clipboard%’
Pause for 1 Seconds
Type the F15 Keystroke
Pause for .5 Seconds
Type the ⇧⌘K Keystroke
Move and Click at (975,480) from the Top Left Corner of the Main Screen
Pause for .5 Seconds
Type the ⇧⌘G Keystroke
Type the ⌘V Keystroke
Type the Return Keystroke

But I keep ending up in the Finder or in Pro Tools without executing “export”. Playing with my pause times gets different results.

You might want to get a little more familiar with Keyboard Maestro. You could easily include an action to check if Pro Tools is Open. :wink:

Great let me know if that solves your problem. Since that script utilizes "Finder" selection and not the "Open & Save" input window I am curious to see if it will even work. If it does I may want to integrate that one somewhere. [quote="rpalagy, post:31, topic:6457, full:true"]
I think it's SHIFT-CMD-G!
[/quote]
That's the "Go To Folder" Command. You could create a macro to type this command and follow with the mouse movements to navigate to the posix path OR even easier SET the POSIX path.

See my previous comment. See if you SET the POSIX path. Much easier than mousing around.

Don’t know if this will help, but I use a great OSX add-on called Default Folder It automatically keeps track of recent files and folders (as well as favorites) and it AppleScriptable. I would imagine you could load the file path from DF using AppleScript and use it in KM the way you intended.

1 Like

Anamorph…I use Default Folder too…a great utility…it used to be rocket-fast but under 11.6 it has become sluggish to respond when dialog boxes open. It actually does do what I want. So far I have settled upon a fairly quick workflow where I have a KM key to grab the path to my Bounced Files folder and then I use CMD-SHIFT-G and paste that path in the export dialog box. Eventually I’ll consolidate it to one keystroke.

Hi Ray

I hope you didn't find a solution yet because then i typed this all for nothin'. :slight_smile:

ProTools and KM user here too.
I do a lot with KM and the real culprit is usually getting data from ProTools. So we have to find smart workarounds for that. As PT is not scriptable. Oliver Momm did a lot with GUI scripts but also he meets the limitations of that.

About your request.

  • Does your sessions have unique names?
  • Is your session file in the Session folder?
  • Is your Bounced Files folder in the Session folder?

If so, you could copy the session name from the "Save As" menu and do a Spotlight search for that in the Finder and it will bring you to the session folder, also containing the Bounced Files folder. Then you are one click away from your Bounced Files folder using the attached KM macro.

My KM macro is attached, but before you use this, you have to make sure the keyboard shortcut for Spotlight Search is changed.
As a ProTools user i disabled command+Space as shortcut for Spotlight Search as i use that shortcut in ProTools for "Record". So, i changed the shortcut for Spotlight Search to ctrl+option+command+F in System Preferences:

Spotlight Search Shortcut

You could make your own shortcut but the following KM macro uses ctrl+option+command+F for Spotlight Search, so you have to edit that to your own shortcut if you do that.

My KM macro:

Current Session Folder

Current ProTools Session Folder.kmmacros (6.1 KB)

Hi Fokke - I did not find a solution so thank you!!! I will try it tomorrow at work! I have been using Default Folder which gets me close.

I’ll let you know how it goes w script!

Best,
Ray Palagu

Hi Ray,

yeah, let me know. There could be some optimisations here and there. I just made this macro just before i uploaded it here, so after a while we can find some things that we can approve.

Hmmm, I changed my Spotlight search to CTRL+OPT+CMD F in Control Panel

Shortcuts.

When I try to run your macro I get stuck on the spotlight window...it opens
and fills in name of session or just last thing it copied. Basically I'm
sitting in the finder after a few moments and nothing has happened.

Just to be clear I don't have a problem with the BOUNCE function. It's
default is the correct location in my opinion - the Bounced Files folder of
the current project. I have issue with Export Selected(CMD_SHIFT-K) I want
that to default to the Bounced Files folder of the current session I'm
in.

Best,
Ray

Hmm. That's odd. Here the macro works fine. Sometimes, the first try does fill in the last thing i had in my copy/paste memory, but the next time it is ok. I could not find why that is. Maybe we have to insert a small pause after the third step; press command-C.

Here is a video of what happens in my studio.

So, at your place, the macro stops when the Spotlight is there? At that point i do a command-R so it tells the finder to go to the folder where the session file is.

But now i understand you don't want to navigate to the Bounced Filed Folder of your current session, you want to set the destination of Export Selected Files the Bounced Files folder of your current session. When i re-read your question now i understand. I have to think about that how to do that.