Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (34 sloc) 1.22 KB
// "T" is a global dictionary, which is used to pass (serialized) values back and forth between apps.
// We can pretend it stands for "transport" or something like that. Idealy, we could get rid of it.
T.pngPath = "/tmp/bob.png";
// The code block for JTalk is sent to Acorn over a CFMessagePort, and it runs it in
// it's own JavaScript instance, using the cocoa bridge.
x = JSTalk("Acorn") {
// changing the variable, just to test that it gets sent back.
T.pngPath = "/tmp/sam.png"
doc ="/Volumes/srv/Users/gus/Desktop/sortme/ridge.acorn");
return true;
if (x) {
// JSApp uses the scripting bridge, so all those apple events you have exposed can
// be put to good use.
QT = JSApp("QuickTime Player");
print("All done.")
else {
print("Not a good response from Acorn...");
// get rid of the image.
jsc.system("rm " + T.pngPath);
This would control iTunes... neat huh?
iTunes = JSApp("iTunes");