Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to create a app with automator to run a bash script?

I want to create a app kind of like Ds Store Remover but it will remove directories instead of just one file. So I was wondering how do I go about doing this I have a bash script the code is below I just need to know what to do. To have the app ask for root password and allow the user to select the directory that they want these directories.


sudo rm -rf “.Thrashes”



sudo rm -rf “.Spotlight-V100”



sudo rm -rf “.Trash”



sudo rm -rf “.DS_Store”

MacBook, OS X El Capitan (10.11.1)

Posted on Feb 12, 2016 9:03 PM

Reply
Question marked as Best reply

Posted on Feb 15, 2016 10:23 AM

Hello D3ATH2020,

You would perform a "do shell script" and append "with administrator privileges". See this technical note from Apple: https://developer.apple.com/library/mac/technotes/tn2065/_index.html


However, I strongly urge you not to attempt what you are doing. There are better ways to handle the .DS_Store files. You do not want to delete those other directories. I mean really you don't want to do that.

4 replies
Question marked as Best reply

Feb 15, 2016 10:23 AM in response to D3ATH2020

Hello D3ATH2020,

You would perform a "do shell script" and append "with administrator privileges". See this technical note from Apple: https://developer.apple.com/library/mac/technotes/tn2065/_index.html


However, I strongly urge you not to attempt what you are doing. There are better ways to handle the .DS_Store files. You do not want to delete those other directories. I mean really you don't want to do that.

How to create a app with automator to run a bash script?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.