Forums > MaxMSP

applescript in max


Aug 11 2008 | 7:46 pm

are there any objects for letting a patch be controlled using applescript? there’s tap.applescript, but it’s part of a package that costs $65, which is too much to pay for 1 small object..

is there some way to do it with [shell]?

thanks.

Aug 11 2008 | 9:41 pm

You should tell what do you expect to do?

Aug 12 2008 | 10:52 am

Quote: Kyred wrote on Mon, 11 August 2008 15:41
—————————————————-
> You should tell what do you expect to do?
—————————————————-

ideally, something along the lines of:

tell application "MaxMSP"
tell object "applescriptobject1"
set output to "5"
end tell
end tell

and then the object in the patch would output 5. obviously this may be too ideal, but is there some kind of hack to acheive something similar?

Aug 12 2008 | 11:04 am

It is possible to pass values to Max/MSP from an applescript though max doesn’t support it.

A really dirty hack way is to use MIDIPipe which is an applescriptable MIDI application. Of course you can only pass MIDI messages through it but that may be sufficient for you?

Aug 12 2008 | 11:06 am

through the almighty shell object, you can use applescript messages with the osascript command.

search the archives for applescript, shell & osacsript

Aug 12 2008 | 11:38 am

both of these sound like possible good options, thanks very much.

Aug 12 2008 | 1:35 pm

Quote: Scott Fitzgerald wrote on Tue, 12 August 2008 05:06
—————————————————-
> through the almighty shell object, you can use applescript messages with the osascript command.
>
> search the archives for applescript, shell & osacsript
—————————————————-

i’m finding a lot to do with sending applescript from within max like this, to control itunes from a max patch etc, but can’t find anything on receiving applescript or apple events inside a patch.

Aug 12 2008 | 2:40 pm

Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 05:04
—————————————————-
> It is possible to pass values to Max/MSP from an applescript though max doesn’t support it.
>
> A really dirty hack way is to use MIDIPipe which is an applescriptable MIDI application. Of course you can only pass MIDI messages through it but that may be sufficient for you?
—————————————————-

likewise with this, it seems that midipipe is not applescriptable, it can only trigger applescript (for other programs)

Aug 12 2008 | 2:53 pm

Sorry, I misunderstood your question.

Can you open a udp socket in your applescript, and send commands to
max through that?

On Tue, Aug 12, 2008 at 4:40 PM, pete

wrote:
>
> Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 05:04
> —————————————————-
>> It is possible to pass values to Max/MSP from an applescript though max doesn’t support it.
>>
>> A really dirty hack way is to use MIDIPipe which is an applescriptable MIDI application. Of course you can only pass MIDI messages through it but that may be sufficient for you?
> —————————————————-
>
> likewise with this, it seems that midipipe is not applescriptable, it can only trigger applescript (for other programs)
>

Aug 12 2008 | 3:30 pm

Quote: peterworth@gmail.com wrote on Tue, 12 August 2008 16:40
—————————————————-
> Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 05:04
> —————————————————-
> > It is possible to pass values to Max/MSP from an applescript though max doesn’t support it.
> >
> > A really dirty hack way is to use MIDIPipe which is an applescriptable MIDI application. Of course you can only pass MIDI messages through it but that may be sufficient for you?
> —————————————————-
>
> likewise with this, it seems that midipipe is not applescriptable, it can only trigger applescript (for other programs)
—————————————————-

It is possible though not documented unfortunately. I’m at work at the moment but when I get home I will write you a quick tutorial. It’s dead easy really.

Aug 12 2008 | 3:33 pm

Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 09:30
> It is possible though not documented unfortunately. I’m at work at the moment but when I get home I will write you a quick tutorial. It’s dead easy really.
>
>
—————————————————-

aha, you’re right – why is it not documented even a little bit??

ok, so it should work something like this?

tell application "MidiPipe"
MIDISend toPort "MidiPipe AppleScript Input" withData {144, 52, 110}
end tell

except this tells me "missing value" for some reason..

Aug 12 2008 | 3:48 pm

Quote: peterworth@gmail.com wrote on Tue, 12 August 2008 17:33
—————————————————-
> Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 09:30
> > It is possible though not documented unfortunately. I’m at work at the moment but when I get home I will write you a quick tutorial. It’s dead easy really.
> >
> >
> —————————————————-
>
> aha, you’re right – why is it not documented even a little bit??
>
> ok, so it should work something like this?
>
> tell application "MidiPipe"
> MIDISend toPort "MidiPipe AppleScript Input" withData {144, 52, 110}
> end tell
>
> except this tells me "missing value" for some reason..
—————————————————-

As I am at work I can’t test it but that sounds about right. Make sure you’ve got your pipe (on the right hand side) set up to output to max. You only need a midi in and a midi out in the pipe unless you want to do any modifications to the data.

As for documentation, the whole aplication is badly documented.

Aug 12 2008 | 3:52 pm

Quote: fairesigneaumachiniste wrote on Tue, 12 August 2008 09:48
—————————————————-
> As I am at work I can’t test it but that sounds about right. Make sure you’ve got your pipe (on the right hand side) set up to output to max. You only need a midi in and a midi out in the pipe unless you want to do any modifications to the data.
>
> As for documentation, the whole aplication is badly documented.
>
—————————————————-

thanks for sorting me out with this, it’s a nice application, shame about the documentation.

i thought i would only need Midi Out, no need for Midi In, but it turns out that’s what this missing value was all about. works now! thanks again.

Aug 12 2008 | 3:54 pm

Quote: Scott Fitzgerald wrote on Tue, 12 August 2008 08:53
—————————————————-
> Sorry, I misunderstood your question.
>
> Can you open a udp socket in your applescript, and send commands to
> max through that?

—————————————————-

still looking into this as well – "do shell script" and then using "nc" will hopefully work, cheers

Aug 12 2008 | 11:22 pm

pete wrote:
> apple events inside a patch.
maybe you can use this:
http://www.naotokui.com/2002/02/maxmsp-objects-2002/
scroll down to cocoa_max

p


http://pure.test.at
http://www.myspace.com/pvre
http://www.heartchamberorchestra.org

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

Forums > MaxMSP