Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
- Subject: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 29 Mar 2010 19:58:11 -0400
Something added some spurious "\n"s to the perl code. It should just be this:
do shell script "perl -MFile::Find -le 'find(sub { return if -d || $_
eq \".DS_Store\"; $mtime = (lstat $_)[9]; $newest =
[$File::Find::name, $mtime] if (!$newest || $mtime > $newest->[1]); },
shift); print $newest->[0]' " & (quoted form of POSIX path of
myFolder)
which will return the POSIX path of the newest non-folder,
non-.DS_Store file under myFolder.
On Mon, Mar 29, 2010 at 7:39 PM, Cosgrave Valentine <email@hidden> wrote:
> Mark's last seems to have done the job.
> do shell script "perl -MFile::Find -le 'find(sub { return if -d || $_\neq
> \".DS_Store\"; $mtime = (lstat $_)[9]; $newest =\n[$File::Find::name,
> $mtime] if !$newest || $mtime > $newest->[1]; },\nshift); print
> $newest->[0]' " & (quoted form of POSIX path of myFolder)
> Thrilled.
> Much appreciated.
> Val
>
>
> I had been preparing this email to spur a different approach
> I came across a script in my search of the various threads.
>
> set theList to (do shell script "/usr/bin/find " & quoted form of POSIX path
> of theFolder & " -type f ! -name '\\.*' -print0 | /usr/bin/xargs -0
> /usr/bin/basename | /usr/bin/sort -df")
> This returns the names of all the files (no folders) in the directory in
> paragraph format and in alphabetical order. and is very fast.
> Might there be a way to sort these in date modified order ?
> Please be aware that my level of scripting could be described as high level
> plagiarism.
> Val
>
>
--
Mark J. Reed <email@hidden>
_______________________________________________
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