1

I have thousands of JPG images from a GoPro timelapse recorded in 5 minute increments throughout the day. I need to grab just the 12PM images, but i have to scroll down so far to get to the next file.

Is there a way within Finder/Spotlight/Terminal/Easy Find or other app to search for a file not only by specific date but the specific time. See the image below for an example of my finder window. I don't want to have to scroll through so many images to grab just the 12PM file.

And just to reiterate, I have thousands of images from a 1 year time lapse in various folders all organized.

Finder Screenshot

2
  • 1
    Are those the file names or just the dates?
    – Tetsujin
    Commented Jan 5, 2022 at 18:27
  • 1
    Those are just the dates. I just did a quick screenshot of the "date modified" area in a Finder window. The file name would be GOPR0001.jpg, GOPR0002.jpg, etc. Commented Jan 6, 2022 at 19:37

1 Answer 1

1

Here is an AppleScript solution which will allow you to choose a folder to search in and set the search criteria for the files you want. It will then automatically select the files from your search results, in a new finder window.

Paste this following AppleScript code into a new Script Editor.app document. The code can be run directly within Script Editor. It can also be saved in Script Editor as an "application" then can launched through Finder by double clicking it, like any other app.

NOTE: This version includes a "Month or Month & Day of file creation" to the search criteria.

activate
set monthCreated to text returned of (display dialog ¬
    "Insert Month or Month & Day  of file creation" default answer ¬
    "January 5" buttons {"Cancel", "Continue"} default button 2 cancel button 1 ¬
    with title "File Search Criteria - Step 1")

activate
set timeCreated to text returned of (display dialog ¬
    "Insert Time of Day of file creation" default answer ¬
    "12:00" buttons {"Cancel", "Continue"} default button 2 cancel button 1 ¬
    with title "File Search Criteria - Step 2")

activate
set |AM or PM| to text returned of (display dialog ¬
    "Insert AM or PM" default answer "PM" buttons {"Cancel", "Continue"} ¬
    default button 2 cancel button 1 with title "File Search Criteria - Step 3")

activate
set theFolder to choose folder with prompt "Search in Folder"

set revealTheseFiles to {}

tell application "System Events"
    set theFiles to files of theFolder
    repeat with thisFile in theFiles
        set fileCreationDate to (get creation date of thisFile)
        if monthCreated is in date string of fileCreationDate then
            if timeCreated is in time string of fileCreationDate then
                if |AM or PM| is in time string of fileCreationDate then
                    set end of revealTheseFiles to (thisFile as alias)
                end if
            end if
        end if
    end repeat
end tell

tell application "Finder" to reveal revealTheseFiles

NOTE: This following version does NOT include a "Month or Month & Day of file creation" to the search criteria.

activate
set timeCreated to text returned of (display dialog ¬
    "Insert Time of Day of file creation" default answer ¬
    "12:00" buttons {"Cancel", "Continue"} default button 2 cancel button 1 ¬
    with title "File Search Criteria - Step 1")

activate
set |AM or PM| to text returned of (display dialog ¬
    "Insert AM or PM" default answer "PM" buttons {"Cancel", "Continue"} ¬
    default button 2 cancel button 1 with title "File Search Criteria - Step 2")

activate
set theFolder to choose folder with prompt "Search in Folder"

set revealTheseFiles to {}

tell application "System Events"
    set theFiles to files of theFolder
    repeat with thisFile in theFiles
        set fileCreationDate to (get creation date of thisFile)
        if timeCreated is in time string of fileCreationDate then
            if |AM or PM| is in time string of fileCreationDate then
                set end of revealTheseFiles to (thisFile as alias)
            end if
        end if
    end repeat
end tell

tell application "Finder" to reveal revealTheseFiles

This following animation demonstrates running the above AppleScript code directly from the Script Editor.app.

The animation starts out showing a Finder window with no selected files and ends with the files from the search being selected in the Finder window.

enter image description here

2
  • Thanks so much for that. I will try this out when i get a chance. I will reply back with any results. Once again thanks! Commented Jan 6, 2022 at 19:33
  • insane script! Is it possible to change it in a time period? For example files between 6PM and 6AM. Thanks!!!! Commented Nov 15, 2023 at 6:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .