We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Processing + Textmate
Pages: 1 2 
Processing + Textmate (Read 11370 times)
Re: Processing + Textmate
Reply #15 - Aug 20th, 2009, 10:44pm
 
Yong Bakos's script works for me most of the time, but sometimes Processing would only open up it's default-named sketch, or the default-named sketch would be the foremost window when the "r" key is sent to it (so mine sits in the background unopened). Is anyone else seeing this behavior?

Anyways, an extra delay reliably fixed the problem for me.

Code:

tell application "Processing" to run
tell application "Processing" to activate
delay 2
tell application "Processing" to open POSIX file "${TM_FILEPATH}"
delay 1
tell application "System Events" to tell process "Processing.app"
keystroke "r" using command down
end tell
Re: Processing + Textmate
Reply #16 - Sep 5th, 2009, 7:46am
 
It works, but Processing will open a new window each time a "Run" command is executed from textmate, resulting in my screen being filled with x copies of the same sketch.
So running a sketch involves running it from textmate using command + R, then remember to close both the application and the sketch before switching back to textmate.

It also makes me grind my teeth that the Applescript needs a x seconds delay so that textmate can get the code copied over to processing before running it. This will eventually mean that if you have a lot of code suddenly you have to change the run script.

It just seems a bit hackish, the bad kind of hackish that it:)

Does it need an AppleScript because Processing has no external API for compiling?
Re: Processing + Textmate
Reply #17 - Sep 5th, 2009, 9:51am
 
Ok I ran through the AppleScript documentation and the way to reproduce the workflow of the Pocessing IDE is really simple. I often run a sketch using command + R, then realize I need to change something, goes in the sketch and corrects this and just hit command + R again. This causes the Processing IDE to close the running sketch, resave and run the changed sketch. and the way to do it ...

Quote:
osascript <<EOF


tell application "Processing" to run
tell application "Processing" to activate

tell application "Processing" to reopen POSIX file "${TM_FILEPATH}"

tell application "System Events" to tell process "Processing"
     keystroke "r" using command down
end tell
EOF



Tell Processing to reopen the file, not open it all over again, this also removes the need to delay the app some arbitrary amount of seconds Smiley

Now when having tested a sketch, I don't have to close it, just jump over to textmate and hit command + R again.
Re: Processing + Textmate
Reply #18 - Sep 20th, 2009, 4:25pm
 
Hi,

My first post here.

I tried to run Textmate and Processing with Snow Leopard today, but it didn't work.
The Processing app is started, but when running the programm only a small grey window is displayed (like there was no code added).

Can anyone help me how to figure out where the problem is?
I also tried to use the code in this thread in the bundle editor, but that didn't work either.
Re: Processing + Textmate
Reply #19 - Nov 21st, 2009, 7:30pm
 
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
Re: Processing + Textmate
Reply #20 - Apr 2nd, 2010, 5:55pm
 
Ahhh..  Wink
thank good i finally got rid of the processing edditor Smiley
for me also Yong Bakos script worked but i had to change the save selector to"Current File". But the changement of "Processing" into "Processing.app" didn't worked for me.

Pages: 1 2