Which Programming Language Should I Try First to Manipulate Logic Pro X & KM?


I'm a music producer and just started using KM to shorten workflow in Logic.

I've never learnt any programming languages before. Keyboard Maestro sure works well and saves lots of time. (Bouncing, importing projects most of time.)

But since my goal on using KM with Logic Pro X (LPX) is not just shorten the time but learning programming to adapt it to other purposes. (In lucky case I could get a job that should handle both terms of music and programming world.)

So I listed what might be the first one to learn and hope you guys can suggest which one I should dig in to first.

  1. Applescript
    I've learnt a bit of this while configuring, customizing the KM macros on the forum.
    Still hard to get the result that I've purposed but I've understood bit of the structure.
    But seems like it's not popular than other candidates. (Maybe it's Apple specific language?)

  2. Javascript
    Never tried to learnt or tried before.
    AFAIK, Javascript can be used on the MIDI FX plugin called Scripter included in LPX and also most of web structure.
    Since LPX, KM, Web are share this language, seems it could be the most variable one.

  3. Swift
    Experienced Swift Playgrounds before but it was just for fun and i wasn't into that much. (exp result: I understood outline of programming structure)
    Apple made this app to make people learn easier by game and I think it would be more fun to learn.
    Quoted to Wikipedia some part of LPX was written in Swift.
    And it's younger gen of programming language so I hope it's more fleable to use on modern environments.
    But is this really more versatile and fitter than the others in my useage?
    don't know..

  4. Python
    Around me, learning Python was like fashion during the pandemic.
    Heard that it's easy and versatile.
    Also shell scripts can be used with KM.
    But thinking of work with LPX, KM – will it be right the right choose over JS and other languages?

Not familiar to world of programming, I just having lot of fear and doubts not to spend time on trials and errors. ('Cause making music is my main job now anyhow.)

Which one do you guys recommend to getting familiar with?

Thank you!

If you aren't familiar with programming, it's probably more important to pick up the mind-set rather than any particular language. How to break down a problem into parts, how to define those parts in "programmy" ways, how to get and use data (and the data structures available), and how to combine all those parts back into a whole with loops (repeat, while...) and flow control (if... then) to solve your original problem.

If you can go from a vague "Wouldn't it be nice if..." to a complete and precise outline of what you need to do -- so-called pseudocode -- you're halfway there.

Of course, the best way to practice is to do it -- and using KM itself is a great tool for this. Working at a higher level means you can concentrate on the problem and let KM's actions deal with the nitty-gritty. And you'll find yourself picking up bits of other languages -- AppleScript, bash/zsh, JavaScript, Python... -- as you need them.

Each of the languages you list above could be useful to you, depending on what you are doing. But if you don't know which direction you'll be heading, and if we're only allowed to pick one -- I'd plump for JavaScript. It's no longer just the "language of the web", it crops up all over the place. It's cross-platform, versatile, has plenty of features without being totally overwhelming, and because of its popularity there are plenty of resources out there.

If you want to limit yourself to "what will be useful in LPX" -- I'm sure other Logic users can jump in but, IIRC, it's JavaScript for the Scripter and Objective-C (another for your list!) for plugins (though I suspect the LPX team will get caught up in Apple's move to Swift-for-everything eventually). And given the evidence on this Forum of Logic's lack of proper scriptability, either JXA or AppleScript so you can attempt to manipulate the GUI...


Excellent advice there from @Nige_S. Logic is a fickle mistress and isn't really very scriptable. AppleScript for UI interaction can work some of the time, but element paths tend to be changeable, and its use is therefore quite limited.

When writing Logic macros, you usually need to think about the actual sequence of operations you would perform manually and then try to convert these to KM actions. This is what @Nige_S refers to as pseudocode.


Had busy days last 2 weeks, sorry for the late reply.

Thanks a lot for your kind and kind comments @Nige_S @noisneil.

These days I'm trying to understand general structure of how the scripts works for computer and where to use effectively.

Since most of my family works in the IT industry, I expect an optimistic outcome without any certain clues (lol).

Good to know of this forum where people have a similar point of view to mine.

Thanks again.