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
Post a Comment