So im not sure if your method is better, (im not much of an applescript expert) but this is what i do and works great for me:
0. select use external editor, in the preference pane
1. open up the pde in processing (open only the first time)
2. open up the pde in textmate
3. edit and save changes within textmate (its important to save before running)
4. hit cmd+r inside textmate
5. watch the sketch being run bye processing
I'm using using this as bundle (based on RickiG's code):
Code:
osascript <<EOF
tell application "Processing" to activate
tell application "System Events" to tell process "Processing"
keystroke "r" using command down
end tell
EOF
It seems processing external editor preference does the same as
Code:tell application "Processing" to reopen POSIX file "${TM_FILEPATH}"
which for some reason my computer wont run properly
anyways
Thats the solution that best worked for me
I hope it helps any of you
cheers