applescript

versions0095+
contributorssojamo
started on2008-04-22 20:35

a example that shows how to make applescript calls from processing using the cocoa.foundation implementation. obviously this is mac/osx only.

Source code

/**
applescript taken from http://processinghacks.com/hacks:applescript
@author sojamo
*/
import com.apple.cocoa.foundation.*;
 
void setup() {
  size(400,400);
}
 
void keyPressed() {
  // applescript example: ask the finder so say something.
  String script = "tell application \"Finder\" to say \"Hello world how are you.\"";
  executeScript(script);
}
 
void draw() {}
 
void executeScript(String script) {
  NSAppleScript myScript = new NSAppleScript(script);
  NSMutableDictionary errors = new NSMutableDictionary();
  myScript.execute(errors);  
}

Related Links

transfered from the ”call applescript” post in the dicourse. http://processing.org

hacks/applescript.txt · Last modified: 2008-05-01 08:25 by florianjenett.de