New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

Automator: elevate to super user?


Post Reply New Thread Subscribe

 
Thread Tools
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,565
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
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!
QUOTE Thanks
Lifeisabeach

 
Lifeisabeach's Avatar
 
Member Since: Sep 30, 2007
Location: Wilmington, NC
Posts: 6,977
Lifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond reputeLifeisabeach has a reputation beyond repute
Mac Specs: iMac i3 (mid-2010) + OS 10.9; TV 3; iPhone 5S; iPad 4

Lifeisabeach is offline
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):

Quote:
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.
QUOTE Thanks
cwa107

 
cwa107's Avatar
 
Member Since: Dec 20, 2006
Location: Middletown, Pennsylvania
Posts: 26,565
cwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond reputecwa107 has a reputation beyond repute
Mac Specs: 15" MBP, Core i7/2GHz, 8GB RAM, 480GB Crucial M500 SSD

cwa107 is offline
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!
QUOTE Thanks

Post Reply New Thread Subscribe


« transmission errors | How to recover cut mail »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Panther user login problem rationalisst OS X - Operating System 1 05-29-2008 03:22 PM
Disk Permissions question alexknibb Apple Notebooks 5 05-17-2008 11:09 AM
my user isn't allowed to administer lisamel OS X - Operating System 1 05-15-2008 12:16 PM
User Switch Problem Red Snapper OS X - Operating System 3 01-27-2007 05:01 AM
Lost connection to my user folder mrouffa OS X - Operating System 5 11-15-2006 11:09 AM

All times are GMT -4. The time now is 08:54 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?