Get command line output on console

Given a command line command -- could be anything, e.g. 'ls -l'. I would somehow like to run something from the Docker that would execute this command and display it in an alert dialog on the console.


How do I get started on this?

Mac mini Unibody no ODD

Posted on Dec 12, 2018 2:56 PM

Reply
23 replies

Dec 15, 2018 11:56 AM in response to markfoley

Mark,


Just an FYI, but the default Apple dialogs are essentially free format (aka ugly), and will wrap long lines. Too many lines, and the dialog will extend below the Dock, which produces another accessibility issue. This can all be overcome with AppleScript/Objective-C, where one can use formatted, attributed text, HTML, and scrollable content as needed.

Dec 14, 2018 6:31 AM in response to VikingOSX

And from the command-line:

apcaccess | osascript 3<&0 <<'AS'
property app_icon : "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/MultipleItemsIcon.icns"
on run argv
  set stdin to do shell script "cat 0<&3"
  display dialog stdin with icon POSIX file app_icon as alias
end run
AS


And the output from apcaccess will appear in a display dialog with custom icon.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Get command line output on console

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.