automator to run AppleScript for a shell script
You'll need to get the POSIX path of the input file:

on run {input, parameters}
    tell application "Terminal"
        activate
        do script "/Users/myaccountname/Applications/TeXcount_3_0/texcount.pl \"" &amp; ( POSIX path of input as string) &amp; "\""
    end tell
end run


I found the answer over at StackOverflow.