I have a script that when run will allow me to search a folder (that I choose) for any sub-folders that have not been modified in the last 90 days…and it works fine, but it returns the entire folder path of what I need
here is the script:
property retention : 90 * days
on run
open {choose folder}
end run
on open source_folder
set start_time to (current date)
set source_folder to item 1 of source_folder as alias
set cut_off to start_time - retention
tell application “Finder” to set the_folders to folders of source_folder
set folders_to_archive to {}
repeat with this_folder in the_folders
set this_folder to (this_folder as alias)
set the_info to (get info for this_folder)
if (modification date of the_info) < cut_off then set end of folders_to_archive to this_folder
end repeat
–do something with folders_to_archive
return folders_to_archive
end open
If i run it it will return:
{alias “Macintosh HD:Users:brianbace:Desktop:Temp_Storage:Floor_Plans:”, alias “Macintosh HD:Users:brianbace:Desktop:Temp_Storage:QC_Check2:”, alias “Macintosh HD:Users:brianbace:Desktop:Temp_Storage:streakers_icons__:”, alias “Macintosh HD:Users:brianbace:Desktop:Temp_Storage:test:”}
Can anyone help me to get this to return just the folder names without the path