• 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
Archiving reminder script fails to work as expected.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Archiving reminder script fails to work as expected.


  • Subject: Archiving reminder script fails to work as expected.
  • From: email@hidden
  • Date: Sun, 22 Feb 2009 11:56:38 EST

My OS v 10.4.3 (Tiger); my Script Editor v 2.1.1 (81)
I've written an "archive reminder" script below, which I'd intended to use as a quick means of finding out the number of days passed from my having last archiving a given folder, and my having edited any of the entire contents of the same folder.
But the script fails to entirely do what I'd expected.
Specifically, folders will show changes in their modification dates when any of their files (top level files) are edited, yet will NOT show a change in modification date when files (nested) within their contained folders are edited.
Thanks in advance for suggestions, Leo.

tell application "Finder"
     tell disk "Macintosh HD"
          tell folder "Users"
               tell folder "leo"
                    set UsersLeoA1 to folder "Documents"
                    set A1Name to name of UsersLeoA1
                    set newDateA1 to modification date of UsersLeoA1
               end tell
          end tell
     end tell
end tell
tell application "Finder"
     tell disk "LaCie"
          tell folder "Archive"
               set LaCieArcA1 to folder "Documents"
               set oldDateA1 to modification date of LaCieArcA1
          end tell
     end tell
end tell
newDateA1 - oldDateA1
result / (60 * 60 * 24) --return (seconds), X (1min/60sec), X (1hr/60min) X (1hr/24min)
round result --round command mathematically correct standard leo
set daysA1 to result
tell application "Finder"
     tell disk "Macintosh HD"
          tell folder "Users"
               tell folder "leo"
                    set UsersLeoA2 to folder "Pictures"
                    set A2Name to name of UsersLeoA2
                    set newDateA2 to modification date of UsersLeoA2
               end tell
          end tell
     end tell
end tell
tell application "Finder"
     tell disk "LaCie"
          tell folder "Archive"
               set LaCieArcA2 to folder "Pictures"
               set oldDateA2 to modification date of LaCieArcA2
          end tell
     end tell
end tell
newDateA2 - oldDateA2
result / (60 * 60 * 24)
round result
set daysA2 to result
tell application "Finder"
     tell disk "Macintosh HD"
          tell folder "Users"
               tell folder "leo"
                    set UsersLeoA3 to folder "Music"
                    set A3Name to name of UsersLeoA3
                    set newDateA3 to modification date of UsersLeoA3
               end tell
          end tell
     end tell
end tell
tell application "Finder"
     tell disk "LaCie"
          tell folder "Archive"
               set LaCieArcA3 to folder "Music"
               set oldDateA3 to modification date of LaCieArcA3
          end tell
     end tell
end tell
newDateA3 - oldDateA3
result / (60 * 60 * 24)
round result
set daysA3 to result
tell application "Finder"
     tell disk "Macintosh HD"
          tell folder "Users"
               tell folder "leo"
                    set UsersLeoA4 to folder "Movies"
                    set A4Name to name of UsersLeoA4
                    set newDateA4 to modification date of UsersLeoA4
               end tell
          end tell
     end tell
end tell
tell application "Finder"
     tell disk "LaCie"
          tell folder "Archive"
               set LaCieArcA4 to folder "Movies"
               set oldDateA4 to modification date of LaCieArcA4
          end tell
     end tell
end tell
newDateA4 - oldDateA4
result / (60 * 60 * 24)
round result
set daysA4 to result

display dialog A1Name & " since modification, unarchived" & tab & daysA1 & " days. " & return & A2Name & " since modification, unarchived" & tab & tab & daysA2 & " days. " & return & A3Name & " since modification, unarchived" & tab & tab & daysA3 & " days. " & return & "[" & A4Name & " since modification, unarchived]" & tab & tab & daysA4 & " days. " & return & return & "Check that new archives have not been created in LaCie/Archive, and, if so, update the writing of this script accordingly. " & return & "NOTE: Movies record—alone!—should be square bracketed. " & return & return & "A handful of archives are stil done on Zip, check sheet for those items \"days last archived\". " buttons {"Cancel", "Open LaCie/Archive", "Finished, close dialog"} default button 3 with icon 1
if button returned of result is "Open LaCie/Archive" then
     tell application "Finder"
          open alias "LaCie:Archive:"
          activate
     end tell
end if



**************
A Good Credit Score is 700 or Above. See yours in just 2 easy steps! (http://pr.atwola.com/promoclk/100126575x1218822736x1201267884/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072&hmpgID=62&bcd=febemailfooterNO62)
 _______________________________________________
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

  • Follow-Ups:
    • Re: Archiving reminder script fails to work as expected.
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Next by Date: Re: adding a new rule to Mail
  • Previous by thread: Re: AppleScript-Users Digest, Vol 6, Issue 87
  • Next by thread: Re: Archiving reminder script fails to work as expected.
  • Index(es):
    • Date
    • Thread