I'm not familiar with Alfred however as far as AppleScript and getting an Application Bundle's Icon's pathname is typically not hardcoded, so it's not like you can get its path with a single command. Additionally the value of
CFBundleIconFile can be with and without the
.icns extension, so when building the fully qualified pathname of the Application Bundle's Icon you'll need to take that into consideration as you write your code.
As an example, using the built-in
/Applications/Calculator.app/Contents/Info.plist shows that the Icon file is "Calculator.icns" but doesn't give the path, although it will usually be within the Resources folder within the Application Bundle and in this case it's,
/Applications/Calculator.app/Contents/Resources/Calculator.icns. So you'd have to get the value of
CFBundleIconFile from the App's
.plist file and check whether or not it has the
.icns extension and test to see if it's in the default location, which it normally is but not always.
So in Terminal you'd query using
defaults read /Applications/Calculator.app/Contents/Info.plist CFBundleIconFile
In AppleScript you could set the results to a variable and go from there, e.g.:
set appIcon to do shell script "defaults read /Applications/Calculator.app/Contents/Info.plist CFBundleIconFile"
defaults read /Applications/Utilities/Terminal.app/Contents/Info.plist CFBundleIconFile
Yet the FQP is