Jump to content

Applescript for running sudo commands in terminal

applescript sudo do shell script

  • Please log in to reply
No replies to this topic



    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts

I'm a newbie when it comes to Applescript and was wondering if someone could help with a basic request. I need to write a small script to do the following:


1. Launch terminal

2. Run the 'Sudo -s' command

3. Enter the administrator password (in plain text)

and then

4. run some sudo commands like "sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add administrator"


I actually WANT the administrator password to be in the script in plain text even though I understand the security risks (I will literally be the only person to ever see the script). I've trawled forums all over but can't seem to find what I am looking for and cannot get it working by patching together the various commands I have found. Thanks in advance for any help you can give!




Also tagged with one or more of these keywords: applescript, sudo do shell script

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2015 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy