• 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: Re. Help with simple grep - Thanks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re. Help with simple grep - Thanks


  • Subject: Re: Re. Help with simple grep - Thanks
  • From: Skeeve <email@hidden>
  • Date: Sat, 30 Aug 2008 23:22:18 +0200

Skeeve schrieb:
Joe schrieb:
Could I make a one-liner from the two "do shell script" statements? Sort of like this:

set width to paragraphs of (do shell script "mdls -name kMDItemPixelHeight -name kMDItemPixelWidth " & ( quoted form of x ) & " | perl -ne 'print qq/$1\n/ if /(\d+)/'")

should do it.
Sorry! This won't work if the filename contains digits. This is better:

set width to paragraphs of (do shell script "mdls -name kMDItemPixelHeight -name kMDItemPixelWidth " & ( quoted form of x ) & " | perl -ne 'print qq/$1\n/ if $.>1 and /(\d+)/'")

But this assumes that the file exists.
_______________________________________________
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
References: 
 >Re. Help with simple grep - Thanks (From: Joe <email@hidden>)
 >Re: Re. Help with simple grep - Thanks (From: Skeeve <email@hidden>)

  • Prev by Date: Re: Get path to app without launching it
  • Next by Date: Re: Get path to app without launching it
  • Previous by thread: Re: Re. Help with simple grep - Thanks
  • Next by thread: Re: Re. Help with simple grep - Thanks
  • Index(es):
    • Date
    • Thread