I use an app called MIDIpipe, which has a limited implementation of Applescript. One of the limitations is not being able to share variables among “pipes,” which are MIDI event modifier modules.
Currently I am able to store one character on the clipboard with one module and reference with another module, that outputs a pre-programmed MIDI controller. Unfortunately there is only one clipboard.
I am guessing that an array would work here, but I am unfamiliar with the syntax. I would want to declare a 4 element array, and be able to store/retrieve each element separately without disturbing the other elements.
My current code to store/retrieve the variable to the clipboard:
on runme(message)
if (item 1 of message = (144)) and (item 2 of message = 60) and (item 3 of message > 0) then
set myVar to “1”
set the clipboard to myVar
else if (item 1 of message = (144)) and (item 2 of message = 61) and (item 3 of message > 0) then
set myVar to “2”
set the clipboard to myVar (etc)
And to retrieve the variable:
on runme(message)
set MixVar to the clipboard
if (item 1 of message = (144)) and (item 2 of message = 60) and (item 3 of message > 0) then
if (MixVar = "1") then
set (item 1 of message) to (176)
set (item 2 of message) to (60)
set (item 3 of message) to (80) (and so forth)
I am also a Filemaker programmer, learning Applescript has been a blast.
Stublito
Model: MBPro
Browser: Safari 537.36
Operating System: Mac OS X (10.9)