Mac Help Forums


Reply
Thread Tools Display Modes

Running a Unix Command Problem

 
New Member
Join Date: Nov 2005
Posts: 3
 
      10th November 2005
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 Removed)

Thanks.
 
Reply With Quote
 
 
 
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      10th November 2005
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
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      15th November 2005
You could write an AppleScript...

--Open this script in a new Script Editor window.

do shell script "java -Xmx2048mb -jar GraphicDesignQuickTool.jar"

and save it as an Application Bundle, and place the jar inside the bundle.

regards

Ric
 
Reply With Quote
 
New Member
Join Date: Nov 2005
Posts: 3
 
      29th November 2005
Okay, so how do I create an application bundle in automator? Or how do I do it at all?

Thanks.
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      29th November 2005
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
 
Reply With Quote
 
New Member
Join Date: Nov 2005
Posts: 3
 
      30th November 2005
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.
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      30th November 2005
No problem !

glad you got it working.

regards

Ric
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lost minis when using cp unix command nufin Graphics 0 23rd February 2006 10:22 AM
UNIX command for timeout? Jerry Kindall Mac 8 4th December 2005 03:28 PM
UNIX command manual Al Mac 15 14th November 2005 02:35 AM
Unix command line from GUI Gavin Mac 20 30th October 2003 03:51 PM
ESR on Unix & The Command Line Interface Stroller UK Macs 3 22nd October 2003 01:51 PM


All times are GMT +1. The time now is 10:48 AM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
New book about Steve Jobs << take part in it!
Arjan (1 Hour Ago, 09:37 AM)

Help! Stupid computer is automatically logging me out
Elizaboo (12 Hours Ago, 10:41 PM)

URGENT Help. Crazy talk Mac!
Joeker (13 Hours Ago, 09:42 PM)

PDF Document
yura (22 Hours Ago, 12:13 PM)

Difficulties with internet speed (nothing to do with connection)
sammethh (1 Day Ago, 06:36 AM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51