Control common applications with Max?

Alex Kiesl's icon

Hi,

is there a way to control other applications with Max?
E.g. Keynote to load a presentation or skip to the next slide?

Thanks
Alex

pdelges's icon

On a Mac (and as Keynote is for Mac I suppose you're on a Mac) it is possible with AppleScripts (have a look in your 'Utilities' folder.
In Max you can trigger AppleScripts with the shell object and the 'osascript' command.
Programming AppleScripts is not always trivial, and some Apps (especially from Apple) don't propose much scripts functions so you may need to use system events. For instance here is an example to go to the next page in Preview (Preview don't have an included AS routine to turn pages, so you have to emulate the mouse action):
activate application "Preview"
tell application "System Events"
    tell process "Preview"
        click menu item "Down" of menu 1 of menu bar item "Go" of menu bar 1
    end tell
end tell

Alex Kiesl's icon

Thanks Patrick. I will have a look into this.

Best, Alex

gerardo.pellicer's icon

Hi. I would use Shell object to open keynote and aka.keyboard object, to simulate keystrokes.

Roman Thilenius's icon

anything which supports applescript, midi in, audio in, or OSC can somehow listen to max. how far it goes also mostly depends on the slave app.

metamax's icon

This is great.. but some of that functionality seems like a security risk - even if minor. I may only add [shell] to Max's search path when I am using it.

metamax's icon

[edit] whoops.. wrong thread. sorry.