---
title: "init(contentsOf:)"
framework: automator
role: symbol
role_heading: Initializer
path: "automator/amaction/init(contentsof:)"
---

# init(contentsOf:)

Loads an Automator action from a file URL.

## Declaration

```swift
init(contentsOf fileURL: URL) throws
```

## Parameters

- `fileURL`: URL that specifies the location of an action file.

## Return Value

Return Value The initialized action.

## Discussion

Discussion This method is typically invoked by app that use the AMWorkflow class to embed Automator workflows. It is used to allow creation of actions for a workflow.

## See Also

### Initializing and Encoding

- [init(definition:fromArchive:)](automator/amaction/init(definition:fromarchive:).md)
- [write(to:)](automator/amaction/write(to:).md)
