• 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: Selecting newest file in folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting newest file in folder


  • Subject: Re: Selecting newest file in folder
  • From: "Arthur J. Knapp" <email@hidden>
  • Date: Fri, 26 Jul 2002 09:57:07 -0400

> From: email@hidden
> Date: Thu, 25 Jul 2002 19:10:48 EDT

> ... then get info on each item (see Finder Dicitionary,

The "get info" command is actually a part of Standard Additions, and does
not belong to the Finder.

> Then sort the results to the newest.

The Finder's own "sort" command should do the trick.

> Now, I'm sure there is a much more efficient way (Arthur?) to simply ask the
> finder in a single line for all items of folder whatever whose modification
> date is latest, but I'm not familiar with it, being an old-style, verbose
> programmer.

I could do it in one line, but posting a really long line of code to this
mail-server is problematic. :)

set theFolder to alias "MacHD:MyFolder:" -- debug

tell application "Finder"
sort (every file of theFolder) by modification date
set theNewFile to item 1 of result as alias
end tell

theNewFile --> alias "MacHD:MyFolder:NewestFile.new"


> B&P Wrote:
>> I want to be able to select the most recent file in a
>> folder (which has just been created by Filemaker) and move
>> it to to a subfolder.


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.

  • Prev by Date: Re: iTunes play - pause script
  • Next by Date: Fw: Fw: Applescript error -2709 over SSH after hostconfig change
  • Previous by thread: Re: Selecting newest file in folder
  • Next by thread: Trapping for a network error
  • Index(es):
    • Date
    • Thread