Benches macOS

7

Batch UnLock Files including Files in fol…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

So many of my itunes songs are locked, meaning that i cannot add album artwork, song ratings or various other things, and the only way to unlock them is to find them with the finder, and use the "get info" feature, then uncheck the box.

Is there a script or an automator function that would let me select my music folder, and automatically unlock ALL of the songs in a batch process. I found this (below) in an archived discussion forum, but it didn't work for me. I searched google and the discussion archives and found nothing.

Please Help, i don't want to unlock 5000+ songs one at a time !!

tell application "Finder"

-- get the list of files

set fileList to (every file of folder (choose folder) whose locked is true)

-- save the list

set saveFile to (open for access file ((path to desktop as text) & "locked files.out") with write permission)

write fileList to saveFile starting at 0

close access saveFile

-- now change the files

repeat with eachFile in fileList

set locked of eachFile to false

end repeat

end tell

7 replies

Sign in or join Beachball Help to reply.

  1. 0

    Strontium90

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I think an Automator function is a bit too much effort. You can achieve this with a simple command:

    chflags -R nouchg /path/to/folder

    Do a man chflags for details. The -R is recursive, meaning it will apply to the path and all sub-paths.

    Hope this helps

  2. 0

    Community User

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Even better, you can simply use the Finder. That is, it's simple if you want all of your music files to be unlocked. Search for all music files in your home folder, select all of them at once, open a Get Info window (and be
    patient ), then choose to unlock them (and be +very patient+ ).

    Here's some more details and what I did to test this. I opened a Finder window and selected my Music folder, because I let iTunes manage my music and so iTunes keeps everything in there. I then used
    Command-F to start a search. I didn't type anything in the search field, so it doesn't matter whether "
    Contents" or "*File Name*" is selected, but the default search location is "*This Mac*" so I changed that to "
    Music". There is a default search condition of "
    Kind" set to "
    Any", so I changed the "
    Any" to "
    Music" and a listing of files appeared. I left the type of music set to "
    All".

    I skimmed through the listing and it seemed to have a few other things, and then I realized I also had a GarageBand folder in the Music folder. If you just want the iTunes music, then you'll want to be sure to select the "
    iTunes" folder in your Music folder. Somehow I overlooked that the first time. 🙂

    Anyways, I then clicked on one of the items in the search results and then used
    Command-A to select all of them, which can be found in the Edit menu. I used
    Command-I to open an info window, though this command can be found in the File menu as "*Get Info*". Because there were so many items selected at once, only one info window opened instead of thousands of info windows, thankfully. 🙂

    At that point, it was simply a matter of selecting the "
    Locked" checkbox. If some of your items are already locked, but not all of them, you'll see a dash in the checkbox indicating they aren't all the same. Selecting the checkbox will replace that dash with a check and lock them all, and then selecting again will remove the check and unlock all of them. This may take some time if you have thousands of files, so you might want to switch to another app and do other things while you wait.

    As such, click the checkbox +only once+ and then wait a bit, or wait maybe a couple of moments. While the checkbox will change immediately to indicate you've selected it, the task will take much, much longer. Unfortunately there is no window or progress bar to indicate anything is happening when locking and unlocking files. However, as it's trying to complete the task you'll notice the mouse pointer will eventually change to a wait cursor after a couple of moments. Once that has happened, switch to another application you've already opened and do something else if you want. Or maybe read a book.

    When you're in another app and if you leave the mouse cursor hovering over the Desktop or the info window, the cursor will become the wait cursor to let you know the other app is still busy. It doesn't mean you can't use the app you are currently using. Instead, this is helpful so you don't have to switch to the Finder to see if it's done yet.

    Hmm, having said all of that, I realize I left out the possibility of searching for music files that are locked. I did try adding another search condition with the plus button on the far right of the first search condition. I chose "
    Other" and searched for "
    lock" and "
    locked" but didn't come up with anything useful. So, it doesn't seem possible to find only locked or only unlocked files.

  3. 0

    SMCmini

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    i tried that a while ago, but i was fairly impatient. I was fearing the worst when i did command-A, then command-I, I was ready for 5000 windows, but thankfully i just got one with the dash. I'll give it a try again, this time with patience.

    Thanks,

    stephen

  4. 0

    SMCmini

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    i searched my whole mac for music, and when i opened the info, i couldn't change the locked status because it says I have mixed access to my files. How do i not have full access to everything on my computer

  5. 0

    SMCmini

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    now i just searched inside my music folder, and it worked. AWESOME!!!! thanks so much.

    Stephen

  6. 0

    mactoubib

    Imported from the Apple Support Forums via the Wayback Machine 🔗

  7. 0

    red_menace

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The system folders (including the default user ones) have ACL entries, although usually it is just a deny delete. You can get access to everything on your computer, but there may be permissions issues to go around.

    You can also use option-command-I (option Get Info) to bring up the Inspector window for multiple files.