Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
List your installed applications
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="gatorparrots" data-source="post: 291"><p><span style="color: blue">AppleSystemProfiler | grep Applications >> ~/installedApps.txt</span></p><p>This launches the GUI version of Apple System Profiler, but then it pipes the results of the "Applications" tab through a grep seach and then outputs the result to a text file in your home directory. Simple and clean -- it finds all Carbon or Cocoa applications. <em>(Leave off the '>> ~/installedApps.txt' if you want it to output directly to the shell and not to a text file.)</em></p><p></p><p>One caveat: the above code will just find what is in your <strong>/Applications</strong> directory.</p><p></p><p>To search your drive for Cocoa apps, do this:</p><p><span style="color: blue">sudo find / -name "*.app" >> ~/CocoaApps.txt</span></p><p>or</p><p><span style="color: blue">sudo locate '*.app' >> ~/CocoaApps.txt</span></p><p>(very fast, but only accurate if your locate.db has been rebuilt recently)</p><p></p><p>The final approach is slower, but will find and list all applications in /Applications, whether they are Carbon or Cocoa. <em>(AppleScript authored by <strong>pmccann</strong> at forums.macosxhints.com):</em></p><p></p><p>[code]-- Configure this if necessary: exclude_dirs is just a list</p><p>-- of directory names (within starting_dir) that the script </p><p>-- should not examine for applications. If you don't have any</p><p>-- directories that need excluding you can set exclude_dirs to {} </p><p>-----------------------------------------</p><p>set starting_dir to (path to the startup disk as string) & "Applications:"</p><p>set exclude_dirs to {}</p><p>-----------------------------------------</p><p>on getapps(given_dir)</p><p> global app_list, exclude_dirs</p><p> tell application "Finder"</p><p> if the name of folder given_dir is in exclude_dirs then</p><p> set inside_this to {} --just empty it out</p><p> else</p><p> set mylist to (every file of folder given_dir whose file type is "APPL")</p><p> repeat with filex in mylist</p><p> set app_list to app_list & the POSIX path of (filex as alias)</p><p> end repeat</p><p> set inside_this to every folder of folder given_dir</p><p> end if</p><p> end tell</p><p> repeat with another_dir in inside_this</p><p> getapps(another_dir as alias)</p><p> end repeat</p><p>end getapps</p><p>global applist, exclude_dirs</p><p>set app_list to {}</p><p>getapps(starting_dir)</p><p>return app_list[/code]</p></blockquote><p></p>
[QUOTE="gatorparrots, post: 291"] [color=blue]AppleSystemProfiler | grep Applications >> ~/installedApps.txt[/color] This launches the GUI version of Apple System Profiler, but then it pipes the results of the "Applications" tab through a grep seach and then outputs the result to a text file in your home directory. Simple and clean -- it finds all Carbon or Cocoa applications. [i](Leave off the '>> ~/installedApps.txt' if you want it to output directly to the shell and not to a text file.)[/i] One caveat: the above code will just find what is in your [b]/Applications[/b] directory. To search your drive for Cocoa apps, do this: [color=blue]sudo find / -name "*.app" >> ~/CocoaApps.txt[/color] or [color=blue]sudo locate '*.app' >> ~/CocoaApps.txt[/color] (very fast, but only accurate if your locate.db has been rebuilt recently) The final approach is slower, but will find and list all applications in /Applications, whether they are Carbon or Cocoa. [i](AppleScript authored by [b]pmccann[/b] at forums.macosxhints.com):[/i] [code]-- Configure this if necessary: exclude_dirs is just a list -- of directory names (within starting_dir) that the script -- should not examine for applications. If you don't have any -- directories that need excluding you can set exclude_dirs to {} ----------------------------------------- set starting_dir to (path to the startup disk as string) & "Applications:" set exclude_dirs to {} ----------------------------------------- on getapps(given_dir) global app_list, exclude_dirs tell application "Finder" if the name of folder given_dir is in exclude_dirs then set inside_this to {} --just empty it out else set mylist to (every file of folder given_dir whose file type is "APPL") repeat with filex in mylist set app_list to app_list & the POSIX path of (filex as alias) end repeat set inside_this to every folder of folder given_dir end if end tell repeat with another_dir in inside_this getapps(another_dir as alias) end repeat end getapps global applist, exclude_dirs set app_list to {} getapps(starting_dir) return app_list[/code] [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
List your installed applications
Top