Re: Find all PowerPC Applications in Applications folder
Re: Find all PowerPC Applications in Applications folder
- Subject: Re: Find all PowerPC Applications in Applications folder
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 03 Apr 2011 09:36:34 -0400
On Sun, Apr 3, 2011 at 7:12 AM, Christopher Stone
<email@hidden> wrote:
> Alright. After much hacking around I've got something that seems to be
> working reliably, siphons off the SystemFlippers error, and uses only
> built-in Mac OS X tools. I'd have preferred to grab the whole record for
> each ppc app, but I don't yet have enough chops with sed or AWK.
It would be tricky with sed. It's doable with awk, though I find it
easier to think in Perl.
> The script grabs the 'kind' through the 'location' fields from each ppc-app
> record;
One concern, since you mentioned variable output - can we be sure that
"kind" always precede "location" within a given record?
Assuming yes, this one-liner should do the trick:
set ppcApps to paragraphs of (do shell script "system_profiler
SPApplicationsDataType | perl -lne 'print $1 if /Location: (.*)/ &&
$match; $match = ($1 eq 'PowerPC') if /Kind: (.*)/'")
--
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