-1

via Terminal/Totalterminal or iTerm, this script works very well:

cd ~/go/to/dir/ && R -e "shiny::runApp("/go/to/dir", launch.browser=TRUE)"

but as/in a App via Automator, the second Part wont work.

In Automator: run Shell-Script. Where is the difference of "normal" Terminal and the Terminal used by Automator. In both /bin/bash

Teletubbi-OS X
  • 391
  • 1
  • 3
  • 13
  • run shell script is not the same as terminal in automator – Señor O Jul 02 '14 at 15:55
  • 1
    I don't use automator much, but in apple script if you do something out of a canonical comand line (like use R, for example), you must run `tell application "Terminal" activate do shell script "..."` – Señor O Jul 02 '14 at 15:56
  • nearly perfect ;) but so far applescript has problems with `R -e 'shiny::runApp("/Users/1/2/3/", launch.browser=TRUE)'` in AS you need: `"R -e 'shiny::runApp("/Users/1/2/3/", launch.browser=TRUE)'"` Its a problem with the marks. – Teletubbi-OS X Jul 02 '14 at 16:36
  • Yes,I'v try it but always failed. I miss the right psotion for the "\" – Teletubbi-OS X Jul 02 '14 at 16:58
  • post your applescript that you've embedded into an Applescript Automator action and we can help with the quoted forms, etc. – jweaks Jul 03 '14 at 06:01
  • `tell application "Terminal" activate do shell script "cd ~/A/B/C/" delay 1 do shell script "R -e 'shiny::runApp(launch.browser=TRUE)'" in front window end tell` – Teletubbi-OS X Jul 03 '14 at 15:50
  • possible duplicate of [Run Shellscript from Mac Automator](http://stackoverflow.com/questions/25161100/run-shellscript-from-mac-automator) – tripleee Aug 07 '14 at 04:19
  • # Solution http://stackoverflow.com/questions/25161100/run-shellscript-from-mac-automator – Teletubbi-OS X Sep 08 '14 at 12:32

1 Answers1

0

Is r on the path in Automator? If not, replace r with the full path like /usr/local/bin/r (shown by which r).

Lri
  • 26,768
  • 8
  • 84
  • 82