Skip to main content

All-in-one desktop computers from Apple. iMacs were equipped with Intel processors from 2006-2021.

7452 Questions View all

Applescript terminal extension issue

I'm running MacOS Sierra 10.12.2 and trying to create a script (using applescript) for flushing my dns (sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say flushed) but I can't save it with a .sh extension which is the necessary ext to open terminal. It's forcing me to save as .scpt (or another ext based on file type, but none of the options have .sh as an option). Please help!

Answer this question I have this problem too

Is this a good question?

Score 1
Add a comment

1 Answer

Most Helpful Answer

You can accomplish the same thing in a simple bash file written through any text editor (like TextEdit or TextWrangler). It should look something like (# signs indicate commented lines, and #!/bin/bash must be the first line of the file):

Block Image

Save as a .sh such as flushCache.sh. From terminal cd to the saved file's directory, then run sh ./flushCache.sh

Was this answer helpful?

Score 2

1 Comment:

Awesome, I'll try that when I get home. Thanks for getting back to me!

by

Add a comment

Add your answer

Jacob Carrillo will be eternally grateful.
View Statistics:

Past 24 Hours: 0

Past 7 Days: 0

Past 30 Days: 0

All Time: 38