I'm trying to create a script that will bring up a popup window with info that involves a variable created earlier in the script.
I initially made the following and it works:
#!/bin/bash -v
minToRestart=5
osascript -e 'display dialog "Software installations have completed.
Your Mac will automatically reboot in '$minToRestart' minutes.
If you want to restart immediately instead, click the \"Restart Now\" button." with title "Software Update > Updates Complete" buttons {"OK", "Restart Now"} default button "Restart Now"'
However, in looking online it looks like the better way to do this is using the on run argv command. After a lot of troubleshooting I came up with this:
#!/bin/bash -v
minToRestart=5
restartMessage="Software installations have completed.
Your Mac will automatically reboot in '$minToRestart' minutes.
If you want to restart immediately instead, click the \"Restart Now\" button."
osascript -e 'on run {argv}' -e 'display dialog argv with title "Software Update > Updates Complete" buttons {"OK", "Restart Now"} default button "Restart Now"' -e 'end run' $restartMessage
The only problem is that instead of writing the whole $restartMessage, it only writes the first word (Software). What can I do to get it to display the whole $restartMessage variable?