Re: Help with simple grep
Re: Help with simple grep
- Subject: Re: Help with simple grep
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 29 Aug 2008 14:14:29 -0400
On Fri, Aug 29, 2008 at 1:47 PM, Joe <email@hidden> wrote:
> set pth to alias "D1:Users:joe:Pictures:Photos-Scans:500.jpg"
> tell application "Finder" to set x to POSIX path of pth
> set y to do shell script "mdls -name kMDItemPixelHeight " & quoted form of x & "| grep -o ' [0-9]*'"
1. You don't need the Finder to get the POSIX path.
2. Getting rid of the space before [0-9] is what you want, but note
that [0-9]* matches the empty string. grep -o '[0-9][0-9]*'
should do the trick.
--
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