-- fetch the system profiler report tell application "System Profiler" set the_profile to system profile as string end tell -- extract the part of the report we are -- interested in set idx to get offset of "Applications:" in the_profile set idx2 to get offset of "Extensions:" in the_profile set the_profile_apps to characters idx through idx2 of the_profile as string -- loop through report set app_type to 0 repeat with the_line in (every paragraph of the_profile_apps) if the_line starts with " " and the_line does not start with " " then -- if line starts with 4 spaces (not 5), it's the -- start of a new app section set app_type to 0 else if the_line starts with " Kind:" then if the_line contains "Intel" then set app_type to 3 else if the_line contains "Universal" then set app_type to 0 else if the_line contains "PowerPC" then set app_type to 7 else set app_type to 1 end if else if the_line starts with " Location:" then set idx to the offset of ":" in the_line set the_path to characters (idx + 2) through (length of the_line) of the_line as string set the_app to POSIX file the_path tell application "Finder" set label index of the_app to app_type end tell end if end repeat