Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*
- Open & Run Generative Programming IDE
- Author: VoQn
- Usase:
- ex Processing
- $osascript openAndRunSketch.applescript Processing ~/Documents/Processing/sketch/sketch.pde
- ex NodeBox
- $osascript openAndRunSketch.applescript NodeBox ~/Documents/NodeBox/sketch.py
- Last Update: 2010/05/03
- *)
- on run argv
- global ARG_ERR
- global FILE_NOT_FOUND
- set ARG_ERR to "Argument Error :: this script need 2 arguments -> ${ApplicationName} ${SketchFilePath}"
- set FILE_NOT_FOUND to "File not found"
- try
- set appName to item 1 of argv
- set filePath to item 2 of argv
- on error
- return ARG_ERR
- end try
- -- open sketch file
- tell application appName
- activate
- try
- open (filePath as POSIX file)
- on error
- return FILE_NOT_FOUND
- end try
- end tell
- -- run sketch
- tell application "System Events"
- tell application process appName
- key down command
- keystroke "r"
- key up command
- end tell
- end tell
- end run
Add Comment
Please, Sign In to add comment