Running a Unix Command Problem

Joined
Nov 10, 2005
Messages
3
Reaction score
0
Ah, I never clicked the link in my email. Here's my question.

Basically I am trying to run a Unix command through Automator as an application.

java -Xmx2048mb -jar GraphicDesignQuickTool.jar

You're supposed to put the automator app in the same folder as the jar file and it should run the jar with a higher heap size. This works fine if I cd into the directory through the terminal, but for some reason it doesn't know where the app is. Running this causes an error.

I want it to be able to work in any directory as long as it is in the same one as the GDQT.jar, so I can't manually put in a path as that defeats the point. (although it works if I do that)

Reply to (e-mail address removed)

Thanks.
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hmm...

I think you will have to wrap the commands in an AppleScript, that will in turn return the 'a path to me'

I will have a further think...it would be something like this


set pathToMe to the enclosing folder as POSIX path
do shell script "cd " & pathToMe
do shell script "Java -Xmx2048mb -jar GraphicDesignQuickTool.jar"

this is not a working script...still thinking !

regards

Ric
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
Hi,

First try the "AppleScript Application Bundle"

The Script above needs to be saved as an Application Bundle and then add in the 'jar' into the resources folder, I'm not sure whether this will work because I haven't got the 'jar' to try it with...

This document explains Bundles a bit more...http://www.apple.com/applescript/scripteditor/04.html

regards

Ric
 
Joined
Nov 10, 2005
Messages
3
Reaction score
0
Ah, okay I see. Yeah, my compiler lets me do that. I actually used Apple's Dev Tools application Jar Bundler to increase the heap size like I wanted, so problem solved, but it's good to know anyway. Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top