Re: Help with simple grep
Re: Help with simple grep
- Subject: Re: Help with simple grep
- From: Ronald Hofmann <email@hidden>
- Date: Fri, 29 Aug 2008 20:21:26 +0200
Whenever I have a problem like this I try it in the Terminal.
It works here when I try this in the Terminal:
mdls -name kMDItemPixelHeight "/Users/ronny/Desktop/EigeneIcons/
ScreenCaptain.jpg" | grep -o [0-9]
the result is
2
2
9
ronald
---
Am Fr29.08.2008 ยท 35 um 19:47 schrieb Joe:
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 (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to 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