Re: (resend)
Re: (resend)
- Subject: Re: (resend)
- From: Alex Zavatone <email@hidden>
- Date: Fri, 26 Mar 2010 22:06:31 -0500
On Mar 26, 2010, at 9:22 PM, Mark J. Reed wrote: "ls -1d" & posixPath & "/*/"
Actually almost. That ends up getting too much information and some apps as well:
The / before the * ends up causing problems, but if you remove it, it appears to work fine. But the output is still not sorted properly. Adding t to the parameters fixes that though.
In the terminal, it would look like this:
ls -1dt */
But trying that in Applescript, it doesn't work as expected,
set myShellString to "ls -1dt " & (quoted form of POSIX path of myFolder) & "*/" set myShellResults to do shell script myShellString
This gives this output:
/Optimized PNG/Button bar in layers/ /Optimized PNG/prog info no thumbs/ ...
While what is desired is:
Button bar in layers/ prog info no thumbs/ ...
The desired output is just a line by line listing of the source folder contents that are folders, sorted by most recent first. In this case, these are the two strings that end up working in my situation:
set myShellString to "ls -tl " & (quoted form of POSIX path of myFolder) & " | grep '^d'" set myShellString to "ls -tF " & (quoted form of POSIX path of myFolder) & " | egrep /$"
Using the 'Optimized PNG', directory each shell command expands to:
"ls -tl '/Optimized PNG/' | grep '^d'" "ls -tF '/Optimized PNG/' | egrep /$"
Always looking for better way to get this stuff done and with this approach, the index is generated instantly, instead of locking up the Finder for over 15 seconds. Thanks all for spending the time to offer your help.
- Alex |
_______________________________________________
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