workflow - Applescript: Highlight most recent file from group -


i'd know how you'd go creating action highlight group of files , modification date them, have highlight/select/label file recent date.

update: want on applescript because i've gotten further in that. here's have far

set datelist {} tell application "finder"     set inputlist selection     repeat 1 count (inputlist)         set end of datelist modification date of item of inputlist     end repeat end tell  datelist  --compare section...  set boollist {} set j 1 repeat 1 count (datelist)     if (count (datelist))         set j 0     end if     set end of boollist item of datelist > item (i + j) of datelist end repeat  boollist 

looking @ existing applescript code should sort files you've selected last modified date , return latest result dialog box you:

set datelist {} tell application "finder"     set inputlist selection     repeat 1 count (inputlist)         set end of datelist modification date of item of inputlist     end repeat end tell  --compare section...  set moddate item 1 of datelist repeat 1 count (inputlist)     if datelist's item > moddate         set moddate datelist's item         set theresult displayed name of item of inputlist         set theresultdate item of datelist     end if end repeat  --display result…  display alert "most modified file in selection:" message "" & theresult & " " & theresultdate 

Comments