I would like to open .R files with RStudio on Mac. I tried several times setting it to RStudio as shown here: Open With > Other > RStudio, Always Open With checked.

But it keeps resetting it back to plain R. I don't run plain R ever. How can I track what's causing the reset and is there a way to set it programmatically in a configuration file?

Screenshot of the contextual menu showing the Open With selection

1 Answer 1

  1. Locate your .R file, from the Finder menu bar select File > Get Info.
  2. In the Get Info window, move down to the section for Open with: and select the RStudio.app.
  3. Just below the dropdown list, click on Change All...
  4. You will get a dialog box that says:

    Are you sure you want to change all similar documents to open with the application “RStudio”?

    This change will apply to all documents with extension ".R".
  5. Click Continue. This should set all .R files to open with RStudio.

(Here are sample screenshots using a text file named text.txt.

Screenshot of the Get Info window

Screenshot of the dialog box to confirm changing the application

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .