Error saving script files

I get this dialog box popping up regularly when I am working on a script, even when I am not trying to save anything. It's as if there's an auto-save setting somewhere that is regularly trying to save a file. Very annoying!

Edit: Ah! I think I know why. It's to do with the project folder being backed up to the cloud (Dropbox in this case but I suspect it wouldn't matter which cloud service). The process cannot access the file because it is being used by another process

I think RStudio is trying to keep my R history or .Rproj file auto-saved for me and this is not playing nicely with Dropbox.