43 Folders

43 Folders feed subscription icon - Shiny!Time, Attention, and Creative Work. After 4 years and a lot of productivity pr0n, we’re shifting gears. Re-learn how to use 43 Folders. Then back to work. [»]

”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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
noodle's picture

Unfamiliar with iTerm, but I...

Unfamiliar with iTerm, but I think you could do a:
do shell script "sudo bash" password "abracadabra" (replacing 'abracadabra' with your password).

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.

About Carla

Carla's picture

Bio

     
    EXPLORE 43Folders THE GOOD STUFF

    An Oblique Strategy:
    Not building a wall; making a brick


    STAY IN THE LOOP:

    Subscribe with Google Reader

    Subscribe on Netvibes

    Add to Technorati Favorites

    Subscribe on Pageflakes

    Add RSS feed

    The Podcast Feed

    Inbox Zero

    The original 43 Folders series looking at the skills, tools, and attitude needed to empty your email inbox — and then keep it that way. Don’t miss the free video of Merlin’s Inbox Zero presentation.

    Making Time

    3-part series on attention management for artists and makers. Read Bad Correspondence, The Job You Think You Have, and One Clear Line.