Forums > MaxMSP

AppleScript

June 24, 2009 | 7:46 am

When Max patch/Standalone got a conflict error and shuts down suddenly,an alert message window pops up on the screen.
I’d like to close or hide the pop-up window automatically by AppleScript.
Is Max compliant with AppleScript?

Max/Msp 4.6.3
Jitter 1.6.3


June 24, 2009 | 12:27 pm

You can control max with applescript, for example:

tell application "MaxMSP" to quit
end tell

executed from the script editor would close Max. You can also access the menus, move and click the mouse and trigger keypresses (although I think this requires a seperate toolkit, if memory serves it is called Extra Suites).

You can trigger scrips from inside max using [shell] which you can find here. The format is slightly different because [shell] communicates with the terminal so you’d need to use something like:

osascript -e 'set desktopPath to POSIX path of (path to home folder) as string' -e 'return desktopPath'

to find the current user directory. You also need to be careful to escape "quotes" and ,commas, and any other reserved characters you may find yourself needing. You can also execute applescript files saved to disk from within max.

lh


June 25, 2009 | 1:16 am

Thank you for your advice.
I’m gonna look over Extra Suites.
Thank you!!


June 25, 2009 | 5:43 am
iehos wrote on Wed, 24 June 2009 09:46
When Max patch/Standalone got a conflict error and shuts down suddenly,an alert message window pops up on the screen.
I’d like to close or hide the pop-up window automatically by AppleScript.
Is Max compliant with AppleScript?

Max/Msp 4.6.3
Jitter 1.6.3

Some older topics about AppleScript:
MAX and Applescript
applescript pro needed
Etc.


June 26, 2009 | 12:45 am

Hi PhiDjee,

Thank you for your help.


June 26, 2009 | 1:09 pm
iehos wrote on Fri, 26 June 2009 02:45
Hi PhiDjee,
Thank you for your help.

You’re welcome!
When scripting UI elements with the "System Events", take care of menu items whose titles and numbers could have changed from older versions of any application including Max and the OS.
For example, the Finder’s clipboard was before ‘menu item 8′ and it’s ‘menu item 9′ in Leopard.
Attached, 3 examples in 1 patcher that displays the Clipboard from Max using the shell object, taking care of the Max tokenizers (or just called ‘tokens’).


June 29, 2009 | 2:06 am

Hi OhiDjee,
Thank you very much for the patch you attaced.
I’m gonna take look inside.

All the best!


October 28, 2010 | 10:17 pm

Phidjee or iehos, can you please upload the patch again?

thank you!


October 29, 2010 | 3:55 am

Hi zed ;-)

Here what I found in my archives, two patchers you can start with.
HTH,
Phi-G


Viewing 9 posts - 1 through 9 (of 9 total)