• 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: mdls & .app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mdls & .app?


  • Subject: Re: mdls & .app?
  • From: "Nigel Garvey" <email@hidden>
  • Date: Sun, 20 Feb 2011 23:00:43 +0000

[This hasn't appeared in the Web archive a couple of hours after I sent
it, so I'm posting it again. Apologies for any duplication.]

Christopher Stone wrote on Sun, 20 Feb 2011 09:22:37 -0600:

>On Feb 20, 2011, at 02:44, Steve Thompson wrote:
>> On 20 Feb 2011, at 03:36, Christopher Stone wrote:
>>> # Does not work:
>>> set theApp to "/Applications/TextEdit.app"
>>> set cmd to "mdls " & theApp
>>> do shell script cmd

>The output I would expect from: 'mdls /Applications/TextEdit.app' is
>similar to this which comes from a test text file in the Applications
>Folder:

This is a bit Heath Robinson, but does it help?

  -- set theApp to quoted form of "/Applications/Longish text.txt"
  set theApp to quoted form of "/Applications/TextEdit.app"

  -- mdls a file whose path is either the one provided
  -- or begins with the one provided and contains "/MacOS/".
  set cmd to "file=$(find -f " & theApp & " \\( -type f  -and \\( -path
" & theApp & " -or -path '*/MacOS/*' \\) \\)) ; mdls \"$file\""
  do shell script cmd


NG

 _______________________________________________
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

  • Prev by Date: creating a file within a folder etc...
  • Next by Date: Re: creating a file within a folder etc...
  • Previous by thread: Re: mdls & .app?
  • Next by thread: <no subject>
  • Index(es):
    • Date
    • Thread