Using applet icons in "display dialog"

I have an applet which includes a “icns” file in the “Resources” folder of its bundle. That file contains images of a logo for the applet. I use the logo in a “display dialog” statement:

set custom_icon_file to (path to resource "applet.icns")
display dialog "Alert text" with title "Title" buttons {"OK"} with icon custom_icon_file
 

This code seems to work. But, I’ve realised that I should be using “with icon file”. Yet, the “StandardAdditions” library says that “with icon” can be followed by “text or integer”. Have I accidentally done that ?

Interestingly, the 2013 AppleScript Language Guide only mentions “with icon” followed by any of a resourceSpecifier, iconTypeSpecifier or fileSpecifier. It does not mention “with icon file

So, I’m confused. Can anyone help ?

There’s no file in there – it means a file as in a reference of some sort.

Shane, many thanks. I think I get it although I feel a bit thick.

I have a related question: If I use “with icon note” I don’t get the “Note” icon in the dialog. Instead, I get the applet icon (ie. my logo). If I use “with icon stop”, I get the “Stop” icon but with the applet icon in the bottom right hand quarter. I guess the only way to get the “Note” icon to show is to reset the applet icns file (ie. remove the custom icon file). I’m happy with showing the logo but, I just wonder how it all works.

Cheers.

There is no “note” icon. Those names all date from pre-OS X. When it was updated, they’ve mapped those choices to new icons, and there is no equivalent of the old note icon.