Skip to main content
Added a screenshot
Source Link
TheLearner
  • 739
  • 7
  • 20
  • 35

I have written an Automator application with the following shell script to open an FTP connection on my system:

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
osascript -e 'tell app "Finder" to display alert "SFTP Opened"'

This works exactly as expected except that the sudo command needs a password. When the same command is run on Terminal, it prompts me for a password but when run as an Automator app, doesn't prompt me for any input. Is there anyway to programmatically pass the password to this sudo within the Automator script? I know this is not a safe practice but I still want to do it as my system is reasonably secure and untouched by anyone other than me.

A "do shell script...with administrator privileges" method is giving the following error:

enter image description here

I have written an Automator application with the following shell script to open an FTP connection on my system:

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
osascript -e 'tell app "Finder" to display alert "SFTP Opened"'

This works exactly as expected except that the sudo command needs a password. When the same command is run on Terminal, it prompts me for a password but when run as an Automator app, doesn't prompt me for any input. Is there anyway to programmatically pass the password to this sudo within the Automator script? I know this is not a safe practice but I still want to do it as my system is reasonably secure and untouched by anyone other than me.

I have written an Automator application with the following shell script to open an FTP connection on my system:

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
osascript -e 'tell app "Finder" to display alert "SFTP Opened"'

This works exactly as expected except that the sudo command needs a password. When the same command is run on Terminal, it prompts me for a password but when run as an Automator app, doesn't prompt me for any input. Is there anyway to programmatically pass the password to this sudo within the Automator script? I know this is not a safe practice but I still want to do it as my system is reasonably secure and untouched by anyone other than me.

A "do shell script...with administrator privileges" method is giving the following error:

enter image description here

Tweeted twitter.com/#!/askdifferent/status/465199519270187009
Source Link
TheLearner
  • 739
  • 7
  • 20
  • 35

Passing a password to an Automator application

I have written an Automator application with the following shell script to open an FTP connection on my system:

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
osascript -e 'tell app "Finder" to display alert "SFTP Opened"'

This works exactly as expected except that the sudo command needs a password. When the same command is run on Terminal, it prompts me for a password but when run as an Automator app, doesn't prompt me for any input. Is there anyway to programmatically pass the password to this sudo within the Automator script? I know this is not a safe practice but I still want to do it as my system is reasonably secure and untouched by anyone other than me.