• 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: Get a list of applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get a list of applications


  • Subject: Re: Get a list of applications
  • From: Lewis Butler <email@hidden>
  • Date: Fri, 8 Aug 2003 12:00:09 -0600

On Sunday, 06 July 2003, at 16:04, John Delacour wrote:
At 2:48 pm -0600 6/7/03, Lewis Butler wrote:

On Sunday, Jul 6, 2003, at 10:31 Canada/Mountain, Tom Jones wrote:
I would like to get a list of all of the Applications in the /Applications folder..

do shell script "ls -1 /Applications"


No, but there must be a way with find in the shell. I can't see a way in man find to get just executables.

find /Applications -perm +001 -maxdepth 1

will find all the files in /Applications that are executable by anyone. Trouble is, it finds directories too. And since .app bundles are directories, there really is no way to distinguish, say, /Applications/someApp.app from /Applications/Utilities

find /Applications -perm +001 -name "*.app"

will find just the .app bundles and will search all levels.

BTW, adding a -maxdepth makes find much much faster.

find /Applications -perm +001 -name "*.app" -type d -maxdepth 3

This straightforward AS script will search for apps at the root level and one level down, and it's not too awfully slow.

It seems the best possibility at this point though, unless a syntax like:

set myApps to every file of _appFolder whose file type is "APPL" with depth of 5

is forthcoming...

--
There's nothing to do, so you just stay in bed [ah, poor thing] Why live in the world when you can live in your head?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: A Script
  • Next by Date: Re: Launch AppleScripts without utilizing the WindowServer
  • Previous by thread: Re: Opening a shared FM database (was Re: A Script)
  • Next by thread: Script Debugger 4 and Mac OS 9?
  • Index(es):
    • Date
    • Thread