Help with simple grep
Help with simple grep
- Subject: Help with simple grep
- From: Joe <email@hidden>
- Date: Fri, 29 Aug 2008 10:47:13 -0700
I would like to return only the numeric portion of the string produced by the following script. The example returns "return character, space character, 188" and I'm looking for just "188"
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]*'"
-->"
188"
I tried removing the space before [0-9] but that only returns an empty string.
The only reference for grep I have is the chapter in the BBEdit manual v6. Could you also suggest a good reference for grep?
Joe
_______________________________________________
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