Clemens Dotson
Clemens Dotson

Reputation: 85

How can I run a sudo terminal command from applescript?

How can I run code "sudo ettercap -C" with sudo permissions in applescript?

display dialog "Start ettercap?" buttons {"Boot", "Cancel"}
do shell script "sudo ettercap -C"

This is for a project i'm doing. Dont ask :D

Upvotes: 6

Views: 5558

Answers (1)

vadian
vadian

Reputation: 285074

Instead of sudo use with administrator privileges

display dialog "Start ettercap?" buttons {"Boot", "Cancel"}
do shell script "ettercap -C" with administrator privileges

See Technical Note TN2065: do shell script in AppleScript

Upvotes: 5

Related Questions