Hide Boot Camp partition on desktop?

Discussion in 'OS X Mountain Lion (10.8)' started by amantel, Feb 13, 2013.

  1. macrumors newbie

    Joined:
    Feb 13, 2013
    #1
    Is there a way to do this in Mountain Lion? I have tried using the terminal (chflag, SetFile) but it has not worked. The partition is NTFS but I have Tuxera NTFS installed.
     
  2. macrumors regular

    Toby Ziegler

    Joined:
    Mar 28, 2011
    Location:
    Gallifrey
    #2
    You can hide hard disks from the Finder preferences menu, but it's all or nothing. Admittedly I'm unaware of any other ways to selectively display installed hard disks.

    It's the first checkbox in the attached screenshot.
     

    Attached Files:

  3. thread starter macrumors newbie

    Joined:
    Feb 13, 2013
    #3
    Toby,

    Thank you, I do know about your suggested option. The problem is I want to keep my Mac partition on my desktop, just not my Boot Camp partition.

    Thank you though
     
  4. Partron22, Feb 14, 2013
    Last edited: Feb 14, 2013

    macrumors 65816

    Partron22

    Joined:
    Apr 13, 2011
    #4
    I use this Applescript I wrote a couple years ago:
    Code:
    -- Drive Visibility Toggler
    -- BP 2010
    -- Toggles the desktop visibility of an individual drive
    -- Finder prefs for visibility are preserved, simply superceded by this lower level flag.
    -- Will not work on boot partition
    -- If you use it on a network drive, visibility changes will affect all users.
    -- You must manually target the drive by inserting its name correctly in the next line of code.
    ------------------------------------------------------------------------------------
    ----------- user settable variables
    set drivename to "Betelgeuse" -- **** Set this to the name of the drive you want to act on. ****
    ----------- end of user settable variables
    
    
    if drivename is equal to "Betelgeuse" then -- Make it hard for people who don't know what they're doing to mess up.
    	beep (3)
    	say "You have to type in the name of the drive you want to work with. Please reed the documentation before proceeding"
    	return
    end if
    -----------
    set vizstate to false -- needs a default value
    set findersdriveprefs to getFindersShowDrivePrefs_(me) -- preserve Finder prefs
    
    try
    	tell application "System Events" to set vizstate to visible of disk drivename
    on error
    	beep 1
    	return
    end try
    setFindersShowDrivePrefs_({false, false, false, false}) -- this gets reset at end of function -- every time
    try
    	if vizstate is equal to false then
    		tell application "System Events" to set visible of disk drivename to true
    	else
    		tell application "System Events" to set visible of disk drivename to false
    	end if
    	tell application "System Events" to set vizstate to visible of disk drivename
    	--	do shell script "killall Finder" -- Restart the Finder to show changed visibility This is not necessary as long as I toggle the Finder's vis prefs.
    on error
    	beep 1
    end try
    
    delay 1.2 -- finder needs a little wait in here or it will somtimes display icon incorrectly
    
    setFindersShowDrivePrefs_(findersdriveprefs) --restore Finder prefs
    return vizstate
    
    ------------------------------------------------------------------- Utility Functions
    on getFindersShowDrivePrefs_(sender)
    	set findersdriveprefs to {}
    	tell application id "com.apple.finder"
    		try
    			set end of findersdriveprefs to desktop shows hard disks of Finder preferences as boolean
    			set end of findersdriveprefs to desktop shows external hard disks of Finder preferences as boolean
    			set end of findersdriveprefs to desktop shows removable media of Finder preferences as boolean
    			set end of findersdriveprefs to desktop shows connected servers of Finder preferences
    		on error
    			set findersdriveprefs to {true, true, true, true}
    			beep 1
    			--log "There was an error in getFindersShowDrivePrefs_"
    		end try
    	end tell
    	
    	return findersdriveprefs
    end getFindersShowDrivePrefs_
    
    on setFindersShowDrivePrefs_(findersdriveprefs)
    	tell application id "com.apple.finder"
    		try
    			set desktop shows hard disks of Finder preferences to item 1 of findersdriveprefs
    			set desktop shows external hard disks of Finder preferences to item 2 of findersdriveprefs
    			set desktop shows removable media of Finder preferences to item 3 of findersdriveprefs
    			set desktop shows connected servers of Finder preferences to item 4 of findersdriveprefs
    		on error
    			--log "There was an error in setFindersShowDrivePrefs_"
    			beep 1
    		end try
    	end tell
    end setFindersShowDrivePrefs_
    
    
    Oh yes, a drive made invisible this way will remain invisible if you unplug it and plug it into another Mac. This can cause confusion, so be aware of what you are doing.
     
  5. thread starter macrumors newbie

    Joined:
    Feb 13, 2013
    #5
    Thank you! Appreciate it!
     

Share This Page