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?

1 Answer 1


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
  • 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.'
    – Snowcrash
    Sep 21, 2012 at 17:27
  • @SnowCrash Updated the script.
    – Daniel Beck
    Sep 21, 2012 at 18:45

You must log in to answer this question.

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