Display dialog with icon filename
Hi, I'm trying to use a display dialog with an icon specified by filename.
The following specimen code works if I put the display dialog inside the first tell statement (before the second tell statement), but fails (with the error shown at the bottom) if the display dialog is within the second tell statement.
tell application "Numbers"
activate
open (a .numbers file)
tell front document
display dialog "A message to the world." buttons {"OK"} with icon file "MacIntoshHD:Users:pathto.icns"
end tell
end tell
THE ERROR PRODUCED BY THE ABOVE CODE
Numbers got an error: Can’t make file "MacIntoshHD:Users:pathto.icns" of document 1 into type number or string.
I'm obviously missing something, but I can't see what. Any ideas?
Thanks.
tell a
iMac (21.5-inch, Late 2012), OS X El Capitan (10.11)