Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 882173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:23:12+00:00 2026-05-15T12:23:12+00:00

How would I go about creating an AppleScript command that when I just run

  • 0

How would I go about creating an AppleScript command that when I just run the script (or double click it in Finder?), it would run a set of terminal commands? The set of commands completely remove MySQL, and it has become a pain to constantly write them out. The commands are:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf

There is also another command sudo nano /etc/hostconfig that opens a file and I need to delete a line from the file, but that seems like it’d be too hard to code, so I guess I can do that by hand. But it would be a huge help to do this automatically with a single script.

Would it just be a bunch of these commands?

do shell script (...)

Thanks,
Hristo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:23:13+00:00Added an answer on May 15, 2026 at 12:23 pm

    Yes, you would use do shell script.

    However, for the commands where you execute as super user (sudo) you would instead use with administrator privileges. So, for sudo rm /usr/local/mysql you’d do:

    do shell script "rm /usr/local/mysql" with administrator privileges
    

    If your list of commands is long, then it might just be easier to put all your commands into a single shell script file, and then execute that shell script using do shell script:

    do shell script "/path/to/shell/script" with administrator privileges
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Find the line that looks like public partial class Form1… May 16, 2026 at 4:00 pm
  • Editorial Team
    Editorial Team added an answer unload is the standard method of detecting that the user… May 16, 2026 at 4:00 pm
  • Editorial Team
    Editorial Team added an answer There are several basic approaches: Use only local time Use… May 16, 2026 at 4:00 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Just wondering how you would go about creating the effect as seen in the
Was just wondering how I would go about creating a planar shadow from a
I was curious how anyone would go about creating WCF based services using a
Could somebody show me how you would go about creating a mock HTML Helper
I've been mulling over how one would go about creating a P2P system (like
I'm trying to find documentation on how one would go about creating a custom
Are there any tutorials around for how one would go about creating a control
I'm using the generated Finder.h headers from the sdef utility, and it appears that
Hello Im in the midst of creating a social networking site and I would
I am thinking about creating an OAuth library in LabVIEW, but for testing this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.