PDA

View Full Version : Hide Boot Camp partition on desktop?




amantel
Feb 13, 2013, 04:11 PM
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.



Toby Ziegler
Feb 13, 2013, 11:04 PM
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.

amantel
Feb 13, 2013, 11:42 PM
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.
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

Partron22
Feb 14, 2013, 12:52 PM
I use this Applescript I wrote a couple years ago:-- 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.

amantel
Feb 14, 2013, 10:16 PM
I use this Applescript I wrote a couple years ago:-- 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.

Thank you! Appreciate it!