Re: Selecting a file by type and creation date
Re: Selecting a file by type and creation date
- Subject: Re: Selecting a file by type and creation date
- From: Luther Fuller <email@hidden>
- Date: Fri, 22 Apr 2011 14:04:26 -0500
On Apr 22, 2011, at 1:11 PM, Paul Murphy wrote: I have a folder which contains a series of sub-folders, inside each sub-folder is a series of files of different file types. I'd like to get the POSIX path of most recently created JPEG in the most recently created subfolder.
To get what you need, do something like this ...
property testFolder : alias "OS_X:Users:lutherfuller:Library:Caches:com.apple.Safari" tell application "Finder" (sort folders of testFolder by creation date) set mostRecentFolder to (first item of the result as alias) -- (sort (files of mostRecentFolder whose name extension is "jpeg") by creation date) set mostRecentFile to (first item of the result as alias) -- set posixPath to (POSIX path of mostRecentFile) end tell
The (sort (files of ... line is way slow. But, someone will know a 'do shell script ...' solution.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden