On Jan 6, 2009, at 8:47 AM, Christopher Wright wrote:
* I was looking at using the JS patch as a "controller" of sorts
for a basic stateful application (using QC for a UI), but it looks
like the interpreter (and all the variables) get reset/fired up
constantly. Am I missing something or is there no way to store
global variables? Is there a "register" patch or something that
I'm missing?
Put your variables outside of the main function, like this:
var someValue = 0;
function (__number outputNumber) main (__number inputNumber)
{
var result = new Object();
result.outputNumber = someValue;
someValue ++;
return result;
}
Thanks Chris (and to Alex who replied off-list). Since you can assign
an arbitrary number of inputs and outputs I'm using the JS module as a
register where lots of things wire in and out. I'm sure there's a
more efficient way to do it (writing a custom QCPlugin?) but it seems
to be working well enough for me at the moment.
* Somewhat related, I can't seem to find a way to get input from
std I/O or call out to shell commands? Is this really the case?
I'm on Leopard - am I just missing something for what I'm searching
for in terms of the Patch Creator, as that list looks surprisingly
limited.
Surprisingly limited, or surprisingly secure? Remember: If you can
call arbitrary shell commands with QC, so can bad guys, and that
means you lose.
Well, as you mentioned, in safe mode, when you're viewing a qtz, it's
sandboxed anyway (and if it's not, it means you're running an
executable, in which case it's no more or less secure than anything
else you d/l and run), so I guess I'd say it's neither here nor there.
There's a shell command example plugin (/Developer/Examples/Quartz
Composer/PlugIns/) that lets you do this, but it won't work in safe-
mode environment (like safari, or QuickTime, or Modul8). This will
allow you to call out to shell commands.
Thanks, I saw the plugin but it took some searching to find out how to
install them. :)
Also found out how to enable the the private patches (many of them
that look pretty useful) on Kineme, so thanks for that as well!
.l
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]