openSUSE 11.2 64bit, arduino 0019
How in the world do I do something like this:
arduino myfile.pde
...and arduino runs and opens the file.. like every other application ever known to man.
???
openSUSE 11.2 64bit, arduino 0019
How in the world do I do something like this:
arduino myfile.pde
...and arduino runs and opens the file.. like every other application ever known to man.
???
and arduino runs and opens the file.. like every other application ever known to man.
No you are in the world of embedded micro processor control here, your arduino software doesn't open files. You have been cosseted in a small area of computers if you think everything opens files.
Having said that the arduino can only send messages to the serial port, but if something is listing on the port you can get that something to open a file.
Do you mean the Arduino device or the IDE? I've never tried adding a filename as an argument to opening the IDE, but it wouldn't be hard to implement.
IIRC (not near my linux box right now), the "arduino" command is actually a shell script (bash, iirc) that sets up some variables, then invokes the java runtime to kick off the IDE. You would have to modify this script to pick up the command line variables and then pass them on as parameters to the java invocation. That of course assumes that they are then passed thru and interpreted by the IDE, of course (which I don't know off hand). If they aren't, then you have some java coding to do...
Yes thats what I mean. The IDE should start and open my pde file for editing. Then I can associate .pde files with arduino. Then I can double click .pde files in my file manager / shell and arduino will launch and open the file. For editing. Thats all I want.
Thanks for the tips.. looks like java processing.app.Base is what gets invocated.. I'll check it out.
Hi,
I know this thread is old but I'll just post this here for future reference because I couldn't find a post that answers this even though this is posted in the FAQ forum.
I'm a noob myself when it comes to Linux and to Arduino. I was looking for a way to accomplish this and ended up in this thread.
Here's what I ended up doing in the end:
I edited the file arduino (the script that launches the IDE). The last line in my script was:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base
I just added $1 at the end to make the script pass along the first parameter to the Java application. Like this:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base $1
I can now drag associate pde files with the Arduino IDE or create a launcher icon that I can drop files on.
To improve it fiurther I did the following modifications:
TEMPLATE="/somepath/mytemplate.pde"
OPENDOC=${1-$TEMPLATE}
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base $OPENDOC
Unless a file has been passed to the script it now opens a template that I've created instead of a blank file.
i hope this helps someone. It would have helped me...
Cheers,
Per
Great! Exactly what i was looking for. The arduino scrips should ship with this change next version!
/Rasmus