How to quickly find locked file in finder without using Terminal

I am a photographer and lock certain "Keeper" files while shooting sports, air shows, etc. So I deal with thousands of files in just one session at a game or big event. When I download all my files, obviously I can find them using the icon view, but it takes a very long time and scrolling to see the lock on the files. I don't want to use terminal, because it doesn't open a folder and show me them. I find this very frustrating and as popular as Apple MacOs is for photographers and videographers, I am perplexed as to why this isn't built in to the OS already.... Does anyone know a 3rd party app or a way to get the results I am looking for? Thanks for any answers you may have, or suggestions how to accomplish this without quirky or time consuming steps.

Mac mini, macOS 14.4

Posted on May 4, 2024 4:13 AM

Reply
6 replies

May 4, 2024 2:08 PM in response to Solsticeman

I have a working macOS 14.4.1 solution that finds all locked files in a folder and then:

  • Unlocks the individual file
  • Applies a designated Finder tag
  • Relocks the individual file


When it is done with the bullets above, it then pops a new Finder window with every locked file with a tag selected in the same color as the System Settings > Appearance > Accent Color.


The AppleScript solution does not use Finder in the above process and is quite fast for large folder contents.

May 4, 2024 6:48 AM in response to etresoft

As I stated in my post: "I am a photographer and lock certain "Keeper" files while shooting"

Cameras mark the files when you push a lock button after taking a photo you want to edit on your Mac. When you have 4K of photos in a folder, I am looking for a way to locate these files quickly. Your comment suggests I tag the files in the folders already on the Mac. The method you suggest serves no purpose. But thank you for your comment.

May 4, 2024 7:05 AM in response to Solsticeman

Choose Utilities from the Finder's Go menu, open the Script Editor, and run:


set the_text to (do shell script "ls -lO 'path/to/folder'")

set output_text to ""

repeat with this_paragraph in paragraphs of the_text

if this_paragraph contains "uchg" then set output_text to output_text & this_paragraph & return

end repeat

items 1 thru -2 of output_text as string


This can also be done without using the shell, but it's slower:


tell application "Finder"

set the_folder to (choose folder)

set file_count to count files of the_folder

set output_text to ""

repeat with this_file from 1 to file_count

if locked of file this_file of the_folder then set output_text to output_text & name of file this_file of the_folder & return

end repeat

items 1 thru -2 of output_text as string

end tell


(252898)

May 4, 2024 8:04 AM in response to Solsticeman

Would you want something quick that identifies the files in a given folder that are locked and then opens a new Finder window with each of those locked files selected with your current System Settings : Appearance : Accent color? I say quick as it does not use Finder until the selected files are displayed, and that might be very important with hundreds or thousands of files in a folder.


If you had a custom Finder tag already established (e.g. Keep), the same locked files could be tagged at the same time as the locked discovery above. Then, Spotlight could find those tagged files in the future with this syntax:

kind:image tag:keep


May 4, 2024 3:42 PM in response to Solsticeman

Solsticeman wrote:

As I stated in my post: "I am a photographer and lock certain "Keeper" files while shooting"
Cameras mark the files when you push a lock button after taking a photo you want to edit on your Mac.

Well maybe you should have mentioned that first. I'm guessing that is a standard FAT-formatted memory card. You need to investigate how it is marking the files as locked. I can lock a file on a FAT volume in the Finder, but even that has to use a resource fork (and a fake one at that). I don't know how your camera is doing it.

The method you suggest serves no purpose.

It is something that is indexed by Spotlight. It's purpose is specifically to be used in a search.


You need to identify just what your camera is doing and how that is interpreted by the Mac. Maybe it is searchable, maybe not. I was assuming you had files already on the Mac and you were locking them manually. I suggested using a different method that would cause the files to be indexed in Spotlight.

How to quickly find locked file in finder without using Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.