How to display an image / icon in an AppleScript dialog

Hi,

is it possible to display an image in an AppleScript dialog

at the moment my dialog looks like this:

display dialog "Myapp now ? " & "" buttons {"No", "Yes"} default button 1 giving up after 60


I guess basically it should work, now its the question HOW and what are the limitations regarding alignment and image-formats

any idea ?

MacBookPro 15,4" 1,83 GHz && Mac Pro 2,66 Ghz, Mac OS X (10.4.10)

Posted on Feb 23, 2008 5:18 PM

Reply
8 replies

Feb 23, 2008 6:18 PM in response to fidel-castro

Maybe something like this...

activate
display dialog "Want to see a QuickTime movie?" with icon path to resource "QuickTimePlayer.icns" in bundle (path to application "QuickTime Player")
tell application "QuickTime Player"
activate
(open file ":System:Library:CoreServices:Setup Assistant.app:Contents:Resources:TransitionSection.bundle:Contents:Resources:in tro.mov")
tell application "System Events"
keystroke (ASCII character 51) using {command down}
keystroke (ASCII character 102) using {command down}
end tell
end tell


Tom

Feb 24, 2008 1:50 AM in response to fidel-castro

Mh... this is interessting.

i used to drop 2 .icns files into the content of my Application bundle.

a) 1 should be used as application icon:
--
this is working sometimes after saving the file as.app, but sometimes it just falls back to default script icon. whyever

b) second icon is used to display in the dialog mentioned above
This sometimes works, and sometimes i just have again the default script icon inside my dialog.

Actually i dont understand that.
The application Bundles Content drawner, seems to forgot files to and/or resets/forgots its preview images of my icns. That means: i drag a icns to the content and it is displayed with a proper icon. After saving my script is jumps back to default icon.


any idea what might cause that ?

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.

How to display an image / icon in an AppleScript dialog

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