| versions | 0095+ |
|---|---|
| contributors | sojamo |
| started on | 2008-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.
/** 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); }
transfered from the ”call applescript” post in the dicourse. http://processing.org