Identifying Enhaced Applets

Quick question about enhanced applets.
I have a script that generates a list of files in a folder, and identifies them in a table with their extensions. I would like to distinguish between Applets and Enhanced Applets, the the extension is the same. Is there a way using filemanagerlib, System Events or Finder to quickly and easily distinguish between the two types of apps? (Can’t use Icon because some of both have custom icons)

An enhanced applet’s Info.plist’s CFBundleExecutable key contains FancyDropletFat.

Thanks, Mark!

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

on open (droppedItems)
	set infoForItems to {}
	repeat with thisItem in droppedItems
		tell application "Finder"
			set fileName to the name of thisItem
			if name extension of thisItem is "app" then
				set appType to my AppleOrEnhanced(thisItem as text)
				set the end of infoForItems to fileName & " is an " & appType
			else
				set the end of infoForItems to fileName & " is an not an app"
			end if
		end tell
	end repeat
	set userChoice to choose from list infoForItems ¬
		with title ("File Info") ¬
		with prompt ("What kind of apps are they?") ¬
		OK button name ("Okay") ¬
		cancel button name ("Cancel") ¬
		multiple selections allowed false ¬
		with empty selection allowed
	return infoForItems
end open

on AppleOrEnhanced(anAppFile)
	set appPlist to (anAppFile) & "Contents:Info.plist"
	set pListText to read file appPlist
	if "<key>CFBundleExecutable</key>" & linefeed & tab & "<string>FancyDropletFat</string>" is in pListText then
		return "Enhanced Applet"
	else
		return "Apple Applet"
	end if
end AppleOrEnhanced

1 Like

This script is ohw to get runtime environment name.
I think this way is simpler for me.

http://piyocast.com/as/archives/9004