From 246ce74f4e66e4125b9462a0804d24d831f1d659 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 23 Jul 2020 11:17:44 +0200 Subject: [PATCH] updated displaydialog with title, closes #38 --- Installomator.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 334a861..5676592 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -1002,9 +1002,10 @@ runAsUser() { fi } -displaydialog() { # $1: message +displaydialog() { # $1: message $2: title message=${1:-"Message"} - runAsUser /usr/bin/osascript -e "button returned of (display dialog \"$message\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")" + title=${2:-"Installomator"} + runAsUser /usr/bin/osascript -e "button returned of (display dialog \"$message\" with title \"$title\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")" } displaynotification() { # $1: message $2: title @@ -1066,11 +1067,11 @@ checkRunningProcesses() { pkill $x ;; prompt_user) - button=$(displaydialog "The application $x needs to be updated. Quit $x to continue updating?") + button=$(displaydialog "Quit “$x” to continue updating? (Leave this dialogue if you want to activate this update later)." "The application “$x” needs to be updated.") if [[ $button = "Not Now" ]]; then cleanupAndExit 10 "user aborted update" else - runAsUser osascript -e "tell app \"$x\" to quit" + runAsUser osascript -e "tell app “$x” to quit" fi ;; silent_fail)