<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Automator",
  "identifier" : "/documentation/Automator/AMAction/init(definition:fromArchive:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Automator"
    ],
    "preciseIdentifier" : "c:objc(cs)AMAction(im)initWithDefinition:fromArchive:"
  },
  "title" : "init(definition:fromArchive:)"
}
-->

# init(definition:fromArchive:)

Initializes the action with the specified definition.

```
init?(definition dict: [String : Any]?, fromArchive archived: Bool)
```

## Parameters

`dict`

A dictionary that describes the action, including any custom definition properties.

`archived`

If the action is being unarchived, <doc://com.apple.documentation/documentation/Swift/true>; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Return Value

The initialized action.

## Discussion

This is the primary initializer for all Automator classes. The Automator app sends this message to instances of [`AMAction`](/documentation/Automator/AMAction) both when it loads actions bundles and when it unarchives them.

The [`AMAction`](/documentation/Automator/AMAction) object being instantiated should perform whatever initializations are necessary after invoking `super`’s implementation of this method. It can then examine the values in `dict`, particularly if the action had been archived with custom definition properties.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)