| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Marc Epard wrote:
That's a good guess, especially if you are not using the String[] version of Runtime.exec. I am using the following basic code just fine to call osascript:on 10/5/04 9:05 AM, David Rocks wrote: int result = -1; StringBuffer script = new StringBuffer(); ... build script... String[] cmd = {"osascript", "-e", script.toString()}; try { Process p = Runtime.getRuntime().exec(cmd); p.waitFor(); result = p.getExitValue(); } catch (Exception e) { e.printStackTrace(); } Note that if you need access to errors from the call to osascript, then you need to attach to the Process' error stream to get them (p.getErrorStream()). See the Process javadoc for details. Rob |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: runtime.exec (From: Marc Epard <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.