Anyone know why this script works when executed in the Terminal, but doesn’t when it’s done within an applescript? I receive a runtime error “The command exited with a non-zero status.”
Format in the Terminal, it looks like this:
curl -s http://checkip.dyndns.org | awk ‘{print $6}’ | awk ’ BEGIN {FS = “<”} {print $1}’
Format within an applescript, it looks like this:
set publicIP to (do shell script "curl -s http://checkip.dyndns.org | awk '{print $6}' | awk ' BEGIN {FS = " < "} {print $1}'")
I thought it was an escape character issue at first at “<” so I tried it like "<" but it didn’t work either.
Model: MacBook Pro 2.66GHz Intel Core 2 Duo
AppleScript: 2.1.2
Browser: Safari 533.17.8
Operating System: Mac OS X (10.6)
Thanks, Stefan, the simpler one worked like a charm. And just an FYI, escaping & removing the spaces on the other didn’t work. I had already tried that.