Created
June 25, 2019 08:34
-
-
Save maxpietsch/5cbb5c2061af2546f8b4ba2022947db5 to your computer and use it in GitHub Desktop.
macos mrview as applicatio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
APP=mrview | |
mkdir -vp ${APP}.app/Contents/MacOS ${APP}.app/Contents/Resources | |
PATH="$PATH:/usr/libexec" # PlistBuddy in PATH | |
printf '#!/usr/bin/osascript\ntell application "Terminal"\n\tactivate\n\tdo script "mrview; exit"\nend tell\n' > ${APP}.app/Contents/MacOS/${APP} | |
chmod +x ${APP}.app/Contents/MacOS/${APP} | |
PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleDisplayName string ${APP}" | |
PlistBuddy ${APP}.app/Contents/version.plist -c "add ProjectName string ${APP}" |
second attempt (without starting a terminal):
https://drive.google.com/file/d/1-vQH4TZWiJ7Eb-euqYO_CUhkLgcCVBrO/view?usp=sharing
Adjust the path to mrview in /Applications/mrview.app/Contents/document.wflow
if it is not /usr/local/bin/mrview
Associate .mif and .nii files with the mrview app (this does not seem to work for ".mif.gz" and ".nii.gz" though):
brew install duti # or compile https://github.com/moretension/duti
duti -s $(osascript -e 'id of app "mrview"') .nii all
duti -s $(osascript -e 'id of app "mrview"') .mif all
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the above creates an mrview.app application in the local folder