Name: newCard

Type: message

Syntax: newCard

Summary: Sent to a new <card> right after it's created.

Associations: card

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
on newCard -- ask the user to name the new card
  ask "What do you want to call this card?"
  if the result is "Cancel" then delete the target
  else set the name of the target to it
end newCard

Description:
Handle the <newCard> message if you want to create additional <object|objects>, switch <tool|tools>, or do other tasks when a new <card> is created.

Normally, the <newCard> <message> is handled at a higher level of the <message path>, since the newly-created <card> does not yet have a <script> unless the <templateCard> contains one.

The actual creation is not triggered by the <newCard> <message>, so <trap|trapping> the <message> and not allowing it to <pass> does not prevent the <card> from being created.

References: script (property), newBackground (message), card (keyword), object (object), trap (glossary), message (glossary), templateCard (glossary), tool (glossary), message path (glossary), create card (command), paste (command), copy (command), clone (command), pass (control_st)

Tags: objects
