Skip to content

making R64 the default gui

6 messages · David Airey, David Winsemius

#
Dear list,

I have a bit more RAM now and want to make R64 the default GUI.

What is the best way to do this?

The simplest way outside the terminal is to get info on a file and make an application the default for a particular extension, like .r or .rdata, etc. But for some reason this doesn't work with the R.app and R64.app distributed. R64 doesn't stick, and reverts to R in the Get Info window.

Can someone (1) explain this behavior, and (2) provide alternative instructions?

Thank you.

-Dave
#
On Feb 7, 2010, at 1:39 PM, Airey, David C wrote:

            
I usually dragged my files to the Dock icon.
I can reproduce the problem in the sense that I changed the file  
association for .r files to R64.app and it keeps going back to R.app.  
I think it will require editing the file associations database. I  
wasn't sure how to do that but here's a link to some ideas about using  
lsregister. It may be a bit out of date since it appears to have been  
applied to OSX 10.3.

I got what appear to be favorable results by:

a) moving all the old and undesired R_x.app GUI's out of the  
Applications folder and ...
b) running this script from the Apple Script editor:

(*
rebuildLaunchServicesDB.scpt
Locates the lsregister command regardless of OS version, then tells it  
to rebuild the Launch Services Database for all applications in the  
canonical Applications folder
Paul Henegan
bleulyon at mac.com
20.Aug.2008
*)

set theCommand to (do shell script "locate lsregister")
set theArguments to " -kill -r -f -domain local -domain system -domain  
user"
set thePath to " /Applications"--edit this as needed
set theScript to theCommand & theArguments & thePath
do shell script theScript

-------end script-----------

The R64 assignment seems to be "sticking."
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
I did rebuild the launch services using:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

but unlike you I get the same response to trying to change things with the Get Info dialog--it always reverts to R.app rather than R64.app.

I note that the com.apple.launchservices.plist file reads:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>LSHandlers</key>
	<array>
		<dict>
			<key>LSHandlerContentType</key>
			<string>com.apple.rez-source</string>
			<key>LSHandlerRoleAll</key>
			<string>org.r-project.r</string>
		</dict>
	</array>
</dict>
</plist>
On Feb 7, 2010, at 2:15 PM, David Winsemius wrote:

            
#
On Feb 7, 2010, at 4:34 PM, Airey, David C wrote:

            
Did you remove the other R.GUIs from the Applications folder before  
you did that? I moved them out before rebuilding and then moved them  
back in afterward.
#
So I have only two R.GUIs on my system, R.app and R64.app that were installed with from CRAN (R-2.10.1.tar.gz). Are you saying I should move them both out, or all but the R64.app, before rebuilding?

Thank you for this help.
On Feb 7, 2010, at 3:40 PM, David Winsemius wrote:

            
#
I got it now. I kept R64.app in my applications folder, moved R.app out, rebuilt my launch services, and then moved R.app back to my applications folder. Now my R files open with R64.app by default.

Thank you!

-Dave
On Feb 7, 2010, at 3:40 PM, David Winsemius wrote: