Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script and the results



On 15-May-08, at 3:09 PM, Allan Marcus wrote:

Is there a way to display the result of a do shell script in real time, rather than after the script is complete?

You can tell Terminal to run a command with "do script", instead of using "do shell script" yourself, and the command will run in a new Terminal window (and, of course, all the output will be over there and not returned to Applescript, but this is sometimes an acceptable tradeoff.)


e.g. - let's run "top -w" in a window, which runs forever and would never return if you used "do shell script" -


tell application "Terminal" -- get Terminal to run a command in a new window. -- note that you use "do script" here, not "do shell script" do script "top -w" end tell _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >do shell script and the results (From: Allan Marcus <email@hidden>)



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.