• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with simple grep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Help with simple grep
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: Help with simple grep
  • Next by Date: Re: Help with simple grep
  • Previous by thread: Re: Help with simple grep
  • Next by thread: Re: Help with simple grep
  • Index(es):
    • Date
    • Thread