• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File Mod Date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Mod Date


  • Subject: Re: File Mod Date
  • From: has <email@hidden>
  • Date: Mon, 4 Nov 2002 18:18:23 +0000

Steve Savery wrote:

>or whether there is a more refined
>method for achieving the same result?

Filter the files of the folder using the Finder's 'whose' clause:

======================================================================

-------
--RELATIVE DATES

on midnightToday()
set d to current date
set d's time to 0
return d
end midnightToday

on midnightTomorrow()
set d to current date
set d's time to 86400 -- (86400 secs = 24 hrs, so rolls over
[NO-BREAK]to 12:00:00 AM tomorrow)
return d
end midnightTomorrow

-------
--FILTER FILES BY DATE

on listFilesModifiedBetween(folderRef, minDate, maxDate)
tell application "Finder"
return every file of folderRef whose [CONT]
(modification date is greater than or equal to minDate) and [CONT]
(modification date is less than maxDate)
end tell
end listFilesModifiedBetween

on listFilesModifiedToday(folderRef)
return listFilesModifiedBetween(folderRef, midnightToday(),
[NO-BREAK]midnightTomorrow())
end listFilesModifiedToday

-------
--TEST

tell application "Finder" to set folderRef to folder "ePix" of desktop
listFilesModifiedToday(folderRef)

======================================================================

Note: replace [CONT] above with AS's continuation character, Option-L.


HTH

has

--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: File Mod Date
      • From: John W Baxter <email@hidden>
  • Prev by Date: Thanks... (was: 'Parsing, recreatored, nextmost')
  • Next by Date: Re: Removing characters from a string
  • Previous by thread: Re: File Mod Date
  • Next by thread: Re: File Mod Date
  • Index(es):
    • Date
    • Thread