newImage

Sent to a new image right after it's created.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

newImage

# Examples

on newImage -- assign a file to a referenced image if the text of the target is empty then -- no painted pixels answer file "Please choose an image to display:" set the filename of the target to it end if end newImage

# Description

Handle the newImage message if you want to create additional objects, switch tools, or do other tasks when a new image is created.

Normally, the newImage message is handled at a higher level of the message path, since the newly-created image does not yet have a script unless the templateImage contains one.

The actual creation is not triggered by the newImage message, so trap the message and not allowing it to pass does not prevent the image from being created.

# Tags

# See

- **keyword:** templateImage, image - **property:** script - **command:** copy, clone, paste - **glossary:** object, trap, image, message, tool, message path - **control structure:** pass