43 Folders

Back to Work

Merlin’s weekly podcast with Dan Benjamin. We talk about creativity, independence, and making things you love.

Join us via RSS, iTunes, or at 5by5.tv.

”What’s 43 Folders?”
43Folders.com is Merlin Mann’s website about finding the time and attention to do your best creative work.

AppleScript assistance for automation of bash/iTerm?

Quote:
iTerm also supports autolaunching of an Applescript on startup. On startup, iTerm looks for an Applescript called "AutoLaunch.scpt" under ~/Library/Application Support/iTerm. If it is found, the AutoLauch.scpt is launched and executed. This feature can be used to launch multiple sessions in defined windows and tabs when iTerm starts up.
(http://iterm.sourceforge.net/scripting.shtml)

Oooooh, right? :)

What I want to do is use that feature so that I can launch iTerm and enter the sudo bash command, followed by the necessary RETURN and my password. But I'm more than lousy at AppleScript writing. I know this one's a simple task, but I'm having trouble wrapping my (distracted) head around it. Can anyone help, please?

TOPICS: Mac OS X
jason.mcbrayer's picture

You may wish to refrain...

You may wish to refrain from putting your password into your applescript. If you really want sudo to not ask you for your password when you're opening a shell, use the 'visudo' command to put something like this into your /etc/sudoers file:

carla ALL=(ALL) NOPASSWD: ALL

But this isn't such a great idea either: sudo normally asks you for a password for a reason. Either way, you're letting anyone who walks up to your computer where you've left yourself logged in to run anything as root; in the former case you're doing that and giving them your password.

 
EXPLORE 43Folders THE GOOD STUFF

Popular
Today

Popular
Classics

An Oblique Strategy:
Honor thy error as a hidden intention


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Cranking

Merlin used to crank. He’s not cranking any more.

This is an essay about family, priorities, and Shakey’s Pizza, and it’s probably the best thing he’s written. »

Scared Shitless

Merlin’s scared. You’re scared. Everybody is scared.

This is the video of Merlin’s keynote at Webstock 2011. The one where he cried. You should watch it. »