osx - How to execute a shell script from within an .app, and show it in the Terminal? -



osx - How to execute a shell script from within an .app, and show it in the Terminal? -

my goal execute shell script double clicking on os x .app, , terminal visible user (my script has cli gui).

any ideas? i've tried appify can't show terminal window. many thanks.

for interested, found next solution involves using apple script command.

first need create launcher.sh script. utilize code below. many quotes below allow app run path spaces.

#!/bin/bash scriptpath=$(dirname "$0")'/yourscript.sh' osascript -e 'tell app "terminal" script "\"'"$scriptpath"'\""'

use appify generate app bundle. type in terminal it:

appify launcher.sh "your app name"

from finder, right-click on generated app bundle, show bundle contents, , paste yourscript.sh /contents/macos/

osx shell

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -