Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to take an IP address from my Terminal, right click, select Services > Whois and get the results back somehow.

This doesn't exist so I'm wanting to create a simple Automator script to do that. But, I'm running into a few problems.

This is what I've done - Automator Actions:

Get Specified Text

Run Shell Script

for x in "$@";
do whois $x; 

View Results

But all I get in View Results is this:


Any suggestions?

share|improve this question
up vote 1 down vote accepted

Make sure to pass the input to the shell script as arguments and not to STDIN:

For showing the results, you could drag Run AppleScript to the bottom of the pane and use the following commands:

on run {input, parameters}
    set msg to ""
    repeat with itm in input
        set msg to msg & "
" & itm
    end repeat
    tell application "Finder"
        display alert "Whois" message msg
    end tell
end run
share|improve this answer
Awesome answer. Works fine in Automator but I get an error when I run it through the right click menu: 'The action "Run AppleScript" encountered an error.' – Snow Crash Sep 21 '12 at 17:27
@SnowCrash Updated the script. – Daniel Beck Sep 21 '12 at 18:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .