Documentation Archive Developer
Search

Automator Changes for Swift

Automator

Removed AMShellScriptAction.inputFieldSeparator() -> String!
Removed AMShellScriptAction.outputFieldSeparator() -> String!
Removed AMShellScriptAction.remapLineEndings() -> Bool
Modified AMAction
DeclarationIntroduction
From
class AMAction : NSObject {
    init!(definition dict: [NSObject : AnyObject]!, fromArchive archived: Bool)
    init!(contentsOfURL fileURL: NSURL!, error outError: NSErrorPointer)
    var name: String! { get }
    var ignoresInput: Bool { get }
    var selectedInputType: String!
    var selectedOutputType: String!
    var progressValue: CGFloat
    func runWithInput(_ input: AnyObject!, fromAction anAction: AMAction!, error errorInfo: AutoreleasingUnsafeMutablePointer<NSDictionary?>) -> AnyObject!
    func runWithInput(_ input: AnyObject!, error error: NSErrorPointer) -> AnyObject!
    func runAsynchronouslyWithInput(_ input: AnyObject!)
    func willFinishRunning()
    func didFinishRunningWithError(_ errorInfo: [NSObject : AnyObject]!)
    func finishRunningWithError(_ error: NSError!)
    var output: AnyObject!
    func stop()
    func reset()
    func writeToDictionary(_ dictionary: NSMutableDictionary!)
    func opened()
    func activated()
    func closed()
    func updateParameters()
    func parametersUpdated()
    var stopped: Bool { get }
}
OS X 10.10
To
class AMAction : NSObject {
    init?(definition dict: [String : AnyObject], fromArchive archived: Bool)
    init(contentsOfURL fileURL: NSURL) throws
    var name: String { get }
    var ignoresInput: Bool { get }
    var selectedInputType: String?
    var selectedOutputType: String?
    var progressValue: CGFloat
    func runWithInput(_ input: AnyObject?, fromAction anAction: AMAction?, error errorInfo: AutoreleasingUnsafeMutablePointer<NSDictionary?>) -> AnyObject?
    func runWithInput(_ input: AnyObject?) throws -> AnyObject
    func runAsynchronouslyWithInput(_ input: AnyObject?)
    func willFinishRunning()
    func didFinishRunningWithError(_ errorInfo: [String : AnyObject]?)
    func finishRunningWithError(_ error: NSError?)
    var output: AnyObject?
    func stop()
    func reset()
    func writeToDictionary(_ dictionary: NSMutableDictionary)
    func opened()
    func activated()
    func closed()
    func updateParameters()
    func parametersUpdated()
    var stopped: Bool { get }
}
OS X 10.4

Declaration
From
func finishRunningWithError(_ error: NSError!)
To
func finishRunningWithError(_ error: NSError?)

Declaration
From
init!(contentsOfURL fileURL: NSURL!, error outError: NSErrorPointer)
To
init(contentsOfURL fileURL: NSURL) throws

Declaration
From
init!(definition dict: [NSObject : AnyObject]!, fromArchive archived: Bool)
To
init?(definition dict: [String : AnyObject], fromArchive archived: Bool)

Modified AMAction.name
Declaration
From
var name: String! { get }
To
var name: String { get }

Declaration
From
var output: AnyObject!
To
var output: AnyObject?

Declaration
From
func runAsynchronouslyWithInput(_ input: AnyObject!)
To
func runAsynchronouslyWithInput(_ input: AnyObject?)

Declaration
From
func runWithInput(_ input: AnyObject!, error error: NSErrorPointer) -> AnyObject!
To
func runWithInput(_ input: AnyObject?) throws -> AnyObject

Declaration
From
var selectedInputType: String!
To
var selectedInputType: String?

Declaration
From
var selectedOutputType: String!
To
var selectedOutputType: String?

Declaration
From
func writeToDictionary(_ dictionary: NSMutableDictionary!)
To
func writeToDictionary(_ dictionary: NSMutableDictionary)

DeclarationIntroduction
From
class AMAppleScriptAction : AMBundleAction {
    var script: OSAScript!
}
OS X 10.10
To
class AMAppleScriptAction : AMBundleAction {
    var script: OSAScript
}
OS X 10.4

Declaration
From
var script: OSAScript!
To
var script: OSAScript

DeclarationIntroduction
From
class AMBundleAction : AMAction, NSCoding, NSCopying {
    init!(definition dict: [NSObject : AnyObject]!, fromArchive archived: Bool)
    func awakeFromBundle()
    var hasView: Bool { get }
    var view: NSView! { get }
    var bundle: NSBundle! { get }
    var parameters: NSMutableDictionary!
}
OS X 10.10
To
class AMBundleAction : AMAction, NSCoding, NSCopying {
    func awakeFromBundle()
    var hasView: Bool { get }
    var view: NSView? { get }
    var bundle: NSBundle { get }
    var parameters: NSMutableDictionary?
}
OS X 10.4

Declaration
From
var bundle: NSBundle! { get }
To
var bundle: NSBundle { get }

Declaration
From
var parameters: NSMutableDictionary!
To
var parameters: NSMutableDictionary?

Declaration
From
var view: NSView! { get }
To
var view: NSView? { get }

Raw Value Type
From--
ToUInt

DeclarationIntroduction
From
class AMShellScriptAction : AMBundleAction {
    func remapLineEndings() -> Bool
    func inputFieldSeparator() -> String!
    func outputFieldSeparator() -> String!
}
OS X 10.10
To
class AMShellScriptAction : AMBundleAction {
    var remapLineEndings: Bool { get }
    var inputFieldSeparator: String { get }
    var outputFieldSeparator: String { get }
}
OS X 10.4

Modified AMWorkflow
Declaration
From
class AMWorkflow : NSObject, NSCopying {
    class func runWorkflowAtURL(_ fileURL: NSURL!, withInput input: AnyObject!, error error: NSErrorPointer) -> AnyObject!
    init!(contentsOfURL fileURL: NSURL!, error outError: NSErrorPointer)
    func writeToURL(_ fileURL: NSURL!, error outError: NSErrorPointer) -> Bool
    func setValue(_ value: AnyObject!, forVariableWithName variableName: String!) -> Bool
    func valueForVariableWithName(_ variableName: String!) -> AnyObject!
    func addAction(_ action: AMAction!)
    func removeAction(_ action: AMAction!)
    func insertAction(_ action: AMAction!, atIndex index: Int)
    func moveActionAtIndex(_ startIndex: Int, toIndex endIndex: Int)
    @NSCopying var fileURL: NSURL! { get }
    var actions: [AnyObject]! { get }
    var input: AnyObject!
    var output: AnyObject! { get }
}
To
class AMWorkflow : NSObject, NSCopying {
    class func runWorkflowAtURL(_ fileURL: NSURL, withInput input: AnyObject?) throws -> AnyObject
    init()
    convenience init(contentsOfURL fileURL: NSURL) throws
    func writeToURL(_ fileURL: NSURL) throws
    func setValue(_ value: AnyObject?, forVariableWithName variableName: String) -> Bool
    func valueForVariableWithName(_ variableName: String) -> AnyObject
    func addAction(_ action: AMAction)
    func removeAction(_ action: AMAction)
    func insertAction(_ action: AMAction, atIndex index: Int)
    func moveActionAtIndex(_ startIndex: Int, toIndex endIndex: Int)
    @NSCopying var fileURL: NSURL? { get }
    var actions: [AMAction] { get }
    var input: AnyObject?
    var output: AnyObject? { get }
}

Declaration
From
var actions: [AnyObject]! { get }
To
var actions: [AMAction] { get }

Declaration
From
func addAction(_ action: AMAction!)
To
func addAction(_ action: AMAction)

Declaration
From
@NSCopying var fileURL: NSURL! { get }
To
@NSCopying var fileURL: NSURL? { get }

Declaration
From
init!(contentsOfURL fileURL: NSURL!, error outError: NSErrorPointer)
To
convenience init(contentsOfURL fileURL: NSURL) throws

Declaration
From
var input: AnyObject!
To
var input: AnyObject?

Declaration
From
func insertAction(_ action: AMAction!, atIndex index: Int)
To
func insertAction(_ action: AMAction, atIndex index: Int)

Declaration
From
var output: AnyObject! { get }
To
var output: AnyObject? { get }

Declaration
From
func removeAction(_ action: AMAction!)
To
func removeAction(_ action: AMAction)

Declaration
From
class func runWorkflowAtURL(_ fileURL: NSURL!, withInput input: AnyObject!, error error: NSErrorPointer) -> AnyObject!
To
class func runWorkflowAtURL(_ fileURL: NSURL, withInput input: AnyObject?) throws -> AnyObject

Declaration
From
func setValue(_ value: AnyObject!, forVariableWithName variableName: String!) -> Bool
To
func setValue(_ value: AnyObject?, forVariableWithName variableName: String) -> Bool

Declaration
From
func valueForVariableWithName(_ variableName: String!) -> AnyObject!
To
func valueForVariableWithName(_ variableName: String) -> AnyObject

Declaration
From
func writeToURL(_ fileURL: NSURL!, error outError: NSErrorPointer) -> Bool
To
func writeToURL(_ fileURL: NSURL) throws

Declaration
From
class AMWorkflowController : NSController {
    var workflow: AMWorkflow!
    var workflowView: AMWorkflowView!
    unowned(unsafe) var delegate: AnyObject!
    var canRun: Bool { get }
    var running: Bool { get }
    @IBAction func run(_ sender: AnyObject!)
    @IBAction func stop(_ sender: AnyObject!)
    var paused: Bool { get }
    @IBAction func pause(_ sender: AnyObject!)
    @IBAction func step(_ sender: AnyObject!)
    @IBAction func reset(_ sender: AnyObject!)
}
To
class AMWorkflowController : NSController {
    var workflow: AMWorkflow?
    var workflowView: AMWorkflowView?
    unowned(unsafe) var delegate: AnyObject?
    var canRun: Bool { get }
    var running: Bool { get }
    @IBAction func run(_ sender: AnyObject)
    @IBAction func stop(_ sender: AnyObject)
    var paused: Bool { get }
    @IBAction func pause(_ sender: AnyObject)
    @IBAction func step(_ sender: AnyObject)
    @IBAction func reset(_ sender: AnyObject)
}

Declaration
From
unowned(unsafe) var delegate: AnyObject!
To
unowned(unsafe) var delegate: AnyObject?

Declaration
From
@IBAction func pause(_ sender: AnyObject!)
To
@IBAction func pause(_ sender: AnyObject)

Declaration
From
@IBAction func reset(_ sender: AnyObject!)
To
@IBAction func reset(_ sender: AnyObject)

Declaration
From
@IBAction func run(_ sender: AnyObject!)
To
@IBAction func run(_ sender: AnyObject)

Declaration
From
@IBAction func step(_ sender: AnyObject!)
To
@IBAction func step(_ sender: AnyObject)

Declaration
From
@IBAction func stop(_ sender: AnyObject!)
To
@IBAction func stop(_ sender: AnyObject)

Declaration
From
var workflow: AMWorkflow!
To
var workflow: AMWorkflow?

Declaration
From
var workflowView: AMWorkflowView!
To
var workflowView: AMWorkflowView?

Declaration
From
class AMWorkflowView : NSView {
    var editable: Bool
    var workflowController: AMWorkflowController!
}
To
class AMWorkflowView : NSView {
    var editable: Bool
    var workflowController: AMWorkflowController?
}

Declaration
From
var workflowController: AMWorkflowController!
To
var workflowController: AMWorkflowController?

Declaration
From
func workflowController(_ controller: AMWorkflowController!, didError error: NSError!)
To
func workflowController(_ controller: AMWorkflowController, didError error: NSError)

Declaration
From
func workflowController(_ controller: AMWorkflowController!, didRunAction action: AMAction!)
To
func workflowController(_ controller: AMWorkflowController, didRunAction action: AMAction)

Declaration
From
func workflowController(_ controller: AMWorkflowController!, willRunAction action: AMAction!)
To
func workflowController(_ controller: AMWorkflowController, willRunAction action: AMAction)

Declaration
From
func workflowControllerDidRun(_ controller: AMWorkflowController!)
To
func workflowControllerDidRun(_ controller: AMWorkflowController)

Declaration
From
func workflowControllerDidStop(_ controller: AMWorkflowController!)
To
func workflowControllerDidStop(_ controller: AMWorkflowController)

Declaration
From
func workflowControllerWillRun(_ controller: AMWorkflowController!)
To
func workflowControllerWillRun(_ controller: AMWorkflowController)

Declaration
From
func workflowControllerWillStop(_ controller: AMWorkflowController!)
To
func workflowControllerWillStop(_ controller: AMWorkflowController)