Repair disk permissions with applescript

Discussion in 'Mac Programming' started by 1theo0, Nov 17, 2012.

  1. macrumors newbie

    Joined:
    Jul 21, 2012
    #1
    Hello! I want to write an applescript to repair the disk permissions each 2 months. I'll save it as an app and open it with iCal, but I need someone to check if my code is ok so that I don't screw up. Thanks! ;)
     
  2. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    Unless you are having a specific permissions issue, there is no need to repair disk permissions - especially since it does nothing in a user account or for items that were not installed by an Apple installer utility (e.g. dragged from a disk image).
     
  3. thread starter macrumors newbie

    Joined:
    Jul 21, 2012
    #3
    I am constantly improving a theme (hence changing files in /System/Library/PrivateFrameworks/CoreUI) and want to make sure everything's all right...;) I don't want to see the prohibitory sign on boot again- once was enough :eek: :D
     
  4. macrumors regular

    Joined:
    Jan 14, 2011
    Location:
    Swimming In Tsunami
    #4

    why not use bash script. Here mine I have on my Flash Utility Boot Disk.

    I named it .drepair and placed it in $HOME

    Code:
    #!/bin/bash 
    echo "Enter Password"
    # Ask for the administrator password upfront
    sudo v
    # Repair Disk Permissions 
    diskutil repairPermissions /
    # Update share Cache
    sudo update_dyld_shared_cache -force
    #reboot
    sudo shutdown -r +.10
    
     

Share This Page