(* Apple macOS/OSX Automator Service. *) (* Install selected Perl CPAN module! *) (* Customize the CPAN variable below: *) on run {input} set CPAN to "cpanm" try tell application "Terminal" activate tell application "System Events" to keystroke "n" using {command down} end tell tell application "System Events" tell application process "Terminal" set frontmost to true set CMD to CPAN & " " & input keystroke CMD keystroke return end tell end tell end try end run (* Source: https://perlmonks.org/?node_id=1218123 *)