Collapse all open FCPX libraries?

I tend to have multiple FCPX libraries open at once. It's not the most efficient, but it's reality. When FCPX libraries first load, they are all expanded in the FCPX browser, revealing the sometimes-many events they contain. I would like to programmatically collapse all open FCPX libraries.

I know of two ways to collapse a library:

  1. Click the triangle to the left of the library name (instaneous)

  2. The left arrow key (this only works when the expanded library is already selected, and selecting a library is resource-intensive enough that it's not instantaneous)

How can I use Keyboard Maestro to collapse all open and expanded libraries?

What I have tried

I have tried automating the clicking using the "Record" feature, but I have yet to get that to work seamlessly. It also doesn't change dynamically based on the number of libraries that are open, so there may be extra clicks, which is not good.

I have sort-of-successfully automated it using repeating "left arrow:down arrow:pause" actions, but the amount of time it takes for a library to load (which makes it collapsible by left arrow) varies dramatically between libraries, so the pauses all have to be unnecessarily long. Also, this is just as non-dynamic as clicking.

Nothing? Is it not possible to automate this?

I have no idea why people didn't answer you. Maybe they don't have FCPX. Neither do I.

You said "I know of two ways to collapse a library". Are you sure there are no ways to do the same thing using menu commands? If there is a menu command to shrink the currently selected library, then you can probably solve (part of) this problem easily enough using KM actions. I also want to ask if you can use the up/down arrow keys to move from one library to another, or is the mouse the ONLY way to select a library? Since I don't have the app I can't test this.

Is this something that has to work very quickly, as though you are standing there waiting? Or does this macro run when you are away from the computer, meaning that you can tolerate a few seconds of delay between each library?

There are some apps, even from Apple, that don't have keyboard equivalents to mouse clicks. If there are no keyboard equivalents here, then we would have to either consider using AppleScript to solve this, or maybe using the KM's mouse control. The former is something I'm a bit of a novice at. The latter I'm pretty good with, but it's tough helping people with the latter option because things like monitor resolution differences between you and I may cause difficulties in providing support. Not to mention the fact that I don't have FCPX. I'm willing to try a little if you want. If you don't want my help, because I'm not an expert, that's okay too.

Thank you for your reply. Unfortunately, there is no menu command for the action.

I have successfully automated collapsing multiple libraries using mouse clicks, but there are some drawbacks. If you're up for trying to tackle them, I'm in.

Let's start with this: currently, the action (clicking) starts from the same place every time. If the topmost libraries are already collapsed, there is no way to start the clicking partway.

Is there any way to create a macro that waits for the user to click somewhere on screen, then executes its own clicks relative to that location?

If there is no way to perform the action with the keyboard, then we either have to send data to the app using AppleScript signals or using mouse signals. I'm not very good with AppleScript and even if I was good, I'd have to have a copy of FCPX to see how to control it.

One thing you might not have considered is using the mouse to help a KM macro determine where to start working, BUT using a keyboard key to trigger the macro. You don't actually have to use the mouse click to trigger the macro; you can move the mouse to the desired location and THEN press a key to trigger the macro. This is something that people don't often consider. And when the macro is triggered it obtains the location of the mouse using one of the builtin functions or token, and takes it from there. This is the answer to your last question: yes, if a KM macro saves the location of the mouse it can perform work relative to that location. I do this all the time. That is, I save the mouse's location in a variable and do work relative to that location.

I'm surprised nobody has answered your question so far. I'm kind of on a break and I don't often check this forum for messages.

1 Like