The following works fine when launched from Terminal:
#!/bin/bash
nmap -p 22,5900 localhost | grep closed &> /dev/null && { osascript \
-e 'set usr to text returned of (display dialog "Saisissez un nom d'\''administrateur :" default answer "Administrateur" with title "Activation des services de partage…" with icon stop)' \
-e 'set pswd to text returned of (display dialog "Saisissez le mot de passe :" default answer "" with hidden answer with title "Activation des services de partage…" with icon stop)' \
-e 'do shell script "launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist; launchctl load -w /System/Library/LaunchDaemons/ssh.plist" user name usr password pswd with administrator privileges' 2> /tmp/assistance.log
But, for unknown reasons to me, the app produces by Platypus output nothing as though osascript was not compatible with Platypus. I used often Platypus, but this time I don't know how to make it work with the above script.
Update: I have to go inside [APP]/Contents/MacOS/ and double-click on the executable to make it work.
The following works fine when launched from Terminal:
But, for unknown reasons to me, the app produces by Platypus output nothing as though osascript was not compatible with Platypus. I used often Platypus, but this time I don't know how to make it work with the above script.
Update: I have to go inside
[APP]/Contents/MacOS/
and double-click on the executable to make it work.