Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bjbyers

macrumors newbie
Original poster
Apr 1, 2006
20
0
I am trying to write a simple ApplesSript to run a command in terminal which is needed a workaround for an incompatibility problem with a certain Imation storage drive and Mac's running 10.8.2.

I would like the script to do the following
1. Launch Terminal
2. Type the following command "sudo chmod +r /dev/rdisk*"
3. Wait for the user to enter their password which will be required.
4. If possible close after the password is entered or if that is too complicated just leave terminal open and the user can close it themselves.

I have no experience with AppleScript (obviously based on my question), but based on postings online I thought the following would work but it does not.

tell application "Terminal"
activate
do script "sudo chmod +r /dev/rdisk*"
delay 1
end tell


Can someone assist me with this please? Thank you.
 

Kasalic

macrumors regular
Jan 20, 2011
160
2
I am trying to write a simple ApplesSript to run a command in terminal which is needed a workaround for an incompatibility problem with a certain Imation storage drive and Mac's running 10.8.2.

I would like the script to do the following
1. Launch Terminal
2. Type the following command "sudo chmod +r /dev/rdisk*"
3. Wait for the user to enter their password which will be required.
4. If possible close after the password is entered or if that is too complicated just leave terminal open and the user can close it themselves.

I have no experience with AppleScript (obviously based on my question), but based on postings online I thought the following would work but it does not.

tell application "Terminal"
activate
do script "sudo chmod +r /dev/rdisk*"
delay 1
end tell


Can someone assist me with this please? Thank you.

Download Textwrangler from http://www.barebones.com/products/textwrangler/download.html

Put the first line as #!/bin/bash
Then put the second line as your command (sudo chmod +r /dev/rdisk*)

Save the command as whatever you want, but make sure you add the .command extension.

You will then need to go into Terminal and make the file executable by typing chmod -x /path/to/file

You should then be able to run the command by double clicking the file.

*EDIT* Not sure if you need to make the file executable when you use Textwrangler, the file I created didn't need to be.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.