Bring Max to front
I am currently experimenting with "thispatcher" to streamline the handling of my max application and Cubase. I got how I can bring certain patcher windows in full screen or to front, change the window sizes etc. But whenever I have Cubase active and send a midi message to open a certain patcher in full screen, the window opens behind the Cubase window. Could I also let Max change the focus to max, so that the midi command would show the window in front of Cubase? Thanks!
Hi,
You should be able to use "Front" to thispatcher. Or you Switch your Patcher to be always on top with "topmost 1"(window needs to be open already.)
O.
I am already sending "front" and then "fullscreen 1", but Cubase is still in front of Max in Mac OS Sierra, unless I am switching app via missioncontrol. So, this question is not about which window from within Max (or the SA app to be built from it being in front. That part works well for me. I am looking for a way to bring the whole Max program to front via midi input. I am not sure if there is a way to send that specific information to OS X!?
I will try "topmost 1" and see if that will work.
--
actually, i'm not sure it's really possible really from the Max application, but you can use the shell external and send a command to open your max application - if Max is already open, it will have the effect to bring it to front of all applications.
Alright! That got me one step further! I downloaded the latest shell object. I am on Mac OS Sierra, if that should matter.
In Terminal I managed to get Max to the front, indeed, with this! I typed:
*** open /Applications/0\ Musik/Max.app ***
(Note, that my music Apps are in a subfolder)
However, if I send the message ...
*** open /Applications/0\ Musik/Max.app ***
or
*** open "/Applications/0 Musik/Max.app" *** (this is how file paths work on Mac OS with saving or reading presets, so I tried if that was the problem)
... nothing happens. Unfortunately, there is no help with the file object or maybe it is not compatible with Sierra. Any help regarding this would be appreciated! Further, I would like to avoid any externals wherever possible, as that could make my program incompatible with updates or Max or Mac OS.
where did you find your shelle external ? I'm on yosemite, i don't know if it doesn't work on sierra. However, it *should* work, make sure you have the most up to date version, i think it's from there : https://cycling74.com/forums/shell-2013 and if it works, it's probably plausible to assume that it will keep getitng updated as it was rewritten by Jeremy Bernstein of c74. If it doesn't, well maybe it's time to ask for an update !... either way, i wish there is way from within Max and without using this external too, but i do'nt know any...
and by the way, in this older link you have a help patcher (and the sourcecode of this older version...) : https://cycling74.com/tools/bernstein-shell/#.WNqBS46kJMd
i suppose you would need "thisruntime", which does not exist.
the only way how to bring cubase in bg or max in fg is via the OS, so [shell] should be the only chance.
Does something like "shell" also exist for the windows version of Max? I might want to switch OS next year ...
when i remember right there was one for max 4 ...
Ok, now I got it to work with moving the Max app directly into the application folder without a subfolder. Somehow max message always removes the backslash behind the 0 in:
*** open /Applications/0\ Musik/Max.app ***
and makes it ...
*** open "/Applications/0 Musik/Max.app" ***
How can I make max send that backslash?
For the same reason, shell also doesn't seem to be able to open Cubase, as there is a space between "Cubase and "8.5". Max seems to reformat what I copy directly from the terminal.
usually adding one or two (or more - you can do some tries !) backslashes (\\) should do the trick; Also if shel doesn't understand a path with " ; try with '
Thanks, Vichug! That did it! Now I am able to bring Cubase or any Max patcher to the front. At least in Mac OS ... this is SO useful for making music with multiple apps! Much quicker than any Mission Control command. I hope this will somehow also work in Windows 10, once I switch. If anyone knows a way how, I am happy for any hint. Chances are, if there will be a new Mac Pro in 2017 it will be to expensive and I don't want an iMac or notebook in the studio, so I will probably switch to windows sometime next year ...
of course it depends on what you do, but during "normal" work with the user in front of the keyboard, any mac os or windows of the last 20 years will switch between apps using command-tab. there are also great utilities which let you use custom keys for certain apps.
otoh, maybe it would be about time to give us a message to max; open ... just as there is one for "quit"
Use [open 'your path with spaces'] using single quotes, not double