I have a script like this: export P4PORT=192.168.1.132:1666 passwd=`security find-generic-password -ws Exchange | /usr/bin/perl -pe "s/\n//g"` /usr/bin/expect -c "spawn /Users/myname/bin/p4 login; expect \"Enter password:\"; send \"$passwd\r\"; interact" res=`/Users/myname/bin/p4 login -s` osascript <<EOF tell app "System Events" to display dialog "$res" buttons "OK" default button 1 EOF which run
![Can I use expect inside of Automator?](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)