Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automating RStudio (i.e., is it possible to run rstudioapi calls from outside RStudio on macOS?) #288

Open
MatthewHeun opened this issue Nov 12, 2023 · 2 comments

Comments

@MatthewHeun
Copy link

I'm looking for a way to integrate RStudio and Hookmark (https://hookproductivity.com) on macOS. Before the switch to Electron, the following Applescript would work:

    tell application "RStudio"
        activate
        cmd "clipr::write_clip( rstudioapi::getActiveDocumentContext()$path)"
    end tell

Now that Applescript is no longer supported by RStudio, is there another way to send rstudioapi (or other) calls to a running instance of RStudio via the command line? Via Javascript? Via another means?

In short, is it possible to automate RStudio from outside RStudio itself?

If there is a better place to post this question, please let me know.

@kevinushey
Copy link
Contributor

IIRC, we added some infrastructure to support this with the older Qt-based builds of RStudio, but that was never ported to the newer Electron builds. Perhaps this is something we could take a look at again in the future?

@MatthewHeun
Copy link
Author

MatthewHeun commented Nov 14, 2023

IIRC, we added some infrastructure to support this with the older Qt-based builds of RStudio, but that was never ported to the newer Electron builds. Perhaps this is something we could take a look at again in the future?

Thanks! We've been around this block before 🙂. (rstudio/rstudio#3354; electron/electron#4418; rstudio/rstudio#12521)

So maybe consider my question to be a plea for raising the priority for returning Applescript support to the Electron version of RStudio. Unless I'm missing something, there doesn't seem to be a way to automate RStudio on the Mac, which is a real shame. Lots of great things become possible if we can use Applescript to send rstudioapi calls into RStudio from the outside world.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants