Results 1 to 3 of 3
  1. #1

    cwa107's Avatar
    Member Since
    Dec 20, 2006
    Location
    Lake Mary, Florida
    Posts
    26,947
    Specs:
    15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD
    Automator: elevate to super user?
    OK, after many failed Google searches and hours of looking at different Automator tutorials, I'm hoping someone out there has a definitive answer for this seemingly simple question:

    Is it possible to prompt for admin credentials and promote to super user during an Automator workflow (for example, to make a modification to a system directory)?

    I've also tried running a shell script during the workflow, but using sudo just makes the workflow fail.

    Bear with me, I'm relatively new to Automator and scripting on the Mac in general. Thanks in advance.
    Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!

    https://youtu.be/KHZ8ek-6ccc

  2. #2

    Lifeisabeach's Avatar
    Member Since
    Sep 30, 2007
    Location
    The Republic of Neptune
    Posts
    7,757
    The Automator action to elevate to superuser, for tasks such as copying a file to /System/Library/CoreServices in the example you gave me earlier, needs to be an AppleScript. Add a "Run AppleScript" action, then use the following script (modify as need be to your preferences):

    do shell script "sudo cp ~/Desktop/Temp/DefaultDesktop.jpg /System/Library/CoreServices" password "YourAdminPassword" with administrator privileges
    The only problem offhand here is that your password is visible to anyone able to open the Automator workflow. If you save the workflow as an Application (once it's tweaked to your liking), then that's a non-issue. Another option is to use the AppleScript Editor to save the above script as an application, then have the Automator workflow call on that app rather than running the script itself. Of course, that will then require you maintain two files to run this one workflow.

    FYI... this tip was adapted from this source.

  3. #3

    cwa107's Avatar
    Member Since
    Dec 20, 2006
    Location
    Lake Mary, Florida
    Posts
    26,947
    Specs:
    15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD
    Works like a champ, thanks lifeisabeach!
    Liquid and computers don't mix. It might seem simple, but we see an incredible amount of people post here about spills. Keep drinks and other liquids away from your expensive electronics!

    https://youtu.be/KHZ8ek-6ccc

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create super admin user
    By babyface2059 in forum OS X - Operating System
    Replies: 17
    Last Post: 12-17-2010, 04:39 PM
  2. Create a Super User?
    By poiklpu in forum OS X - Operating System
    Replies: 6
    Last Post: 04-19-2010, 09:51 AM
  3. Root User-Super user
    By ethan96 in forum OS X - Operating System
    Replies: 3
    Last Post: 03-31-2009, 10:39 AM
  4. Using the super user account in Terminal by default
    By macaroony in forum Switcher Hangout
    Replies: 3
    Last Post: 06-15-2007, 03:00 PM
  5. Super user
    By alejandrico in forum OS X - Development and Darwin
    Replies: 12
    Last Post: 12-23-2004, 06:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •