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)

Posted on Nov 7, 2015 2:36 PM

Reply
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Display dialog with icon filename

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.