Deprecated AMAction Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.4

definition

Returns the definition of the receiver. (Deprecated in OS X v10.4. Removed for performance reasons. There is no replacement.)

- (NSMutableDictionary *)definition
Return Value

A mutable dictionary containing the current parameters of the action as well as other information.

Discussion

If your action has non-persistent data, it may override this method to append that data to the definition supplied by the superclass and return it.

Special Considerations

This method was removed to allow for performance improvements in the underlying implementation. There is no replacement.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.4.
  • Not available to 64-bit applications.
Declared In
AMAction.h

runWithInput:fromAction:error:

Requests the receiver to perform its task using the specified input from the specified action. (Deprecated in OS X v10.4.)

- (id)runWithInput:(id)input fromAction:(AMAction *)anAction error:(NSDictionary **)errorInfo
Parameters
input

The input for the receiving action. Should contain one or more objects compatible with one of the types specified in the action’s AMAccepts property.

By default, actions can only accept and provide the following types. However, by overriding this method, you can change the types your action can use:

  • Objective-C actions: Accepts and provides types must inherit from com.apple.cocoa.string, com.apple.cocoa.path, com.apple.cocoa.url, or, starting in OS X version 10.5 (v10.5), com.apple.cocoa.data.

  • Shell script actions: Accepts and provides types must inherit from com.apple.cocoa.string or, starting in OS X v10.5, com.apple.cocoa.data.

  • AppleScript actions: Accepts and provides types must inherit from com.apple.applescript.object.

anAction

The action from which the input object was obtained.

errorInfo

If an error occurs, the action returns an error dictionary in this parameter. The keys and values for this dictionary are:

  • OSAScriptErrorNumber (a string constant) — The value for this key is an instance of NSNumber whose integer value indicates an error code. See the header file MacErrors.h in the Carbon Core framework for a list of valid error codes, particularly the section on OSA errors.

  • OSAScriptErrorMessage (a string constant) —The value for this key is an instance of NSString describing the error.

For an example of how to create such a dictionary, see “Implementing runWithInput:fromAction:error:” in “Implementing an Objective-C Action" in Automator Programming Guide.

Return Value

An object containing one or more objects of a data type compatible with a type specified in the receiving action’s AMProvides property. If the receiver does not modify the data passed in input, it should return it unchanged.

Discussion

The input and output objects for actions are usually instances of NSArray. If the receiver encounters problems, it should return by indirection an error dictionary that describes the error.

This method is intended to be overridden. AppleScript actions, however, usually will not need to override this method because the same functionality is provided by an AppleScript script.

Availability
  • Available in OS X v10.4 and later.
  • Deprecated in OS X v10.4.
Declared In
AMAction.h

Deprecated in OS X v10.5

didFinishRunningWithError:

Sent by the receiver to itself when it has finished running asynchronously. (Deprecated in OS X v10.5.)

- (void)didFinishRunningWithError:(NSDictionary *)errorInfo
Parameters
errorInfo

If an error occurred during asynchronous running of the action, upon return contains an instance of NSError that describes the problem.

Discussion

An action that overrides runAsynchronouslyWithInput: should invoke didFinishRunningWithError: on completion, so that Automator can resume running the workflow that the action is part of.

Availability
  • Available in OS X v10.5 and later.
  • Deprecated in OS X v10.5.
Declared In
AMAction.h