Applescript -hiding desktop drive icons

Discussion in 'Mac Programming' started by macstatic, Aug 27, 2013.

  1. macrumors 6502a

    Joined:
    Oct 21, 2005
    #1
    I've had success with a couple of Applescript scripts in hiding hard drive icons on the Finder desktop that I don't need to access (the Mac Pro uses them for backup and cache purposes):

    Hiding the drive icon
    Code:
    quit application "Finder"
    tell application "System Events" to ¬
    	set visible of disk "BACKUP DRIVE" to false
    delay 1
    launch application "Finder"

    Making the drive visible again

    Code:
    quit application "Finder"
    tell application "System Events" to ¬
    	set visible of disk "BACKUP DRIVE" to true
    delay 1
    launch application "Finder"
    However I'm not able to hide a certain drive (nothing happens when I run the "hide" script). This is a bootable backup drive which is daily updated using Chronosync. Is it un-hideable because it's bootable? Is there anything else I can do to hide this drive icon from the desktop?
    I'm using OSX 10.6.8.
     
  2. macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    You can try Finder Preferences.
     

    Attached Files:

  3. thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #3
    Yes, but this hides ALL drives, or ALL external drives, which is not what I want.
     
  4. macrumors newbie

    Joined:
    Oct 13, 2012
  5. thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #5
    Thanks. I tried the Terminal suggestion there and the result was the same as with my Applescript, but.... unlike Applescript it gave me an error message: "Permission denied".
    So I tried adding myself as a new user for the drive, enabling read/write" and then it worked.

    Thanks for heading me in the right direction. I'll have to figure out the correct ownership for my drives.
     

Share This Page