AMShellScriptAction Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Automator.framework |
| Availability | Available in OS X v10.4 and later. |
| Companion guide | |
| Declared in | AMShellScriptAction.h |
Overview
Instances of the AMShellScriptAction class own Automator actions whose runtime behavior is driven by a shell script or by a Perl or Python script.
When you create a Shell Script Automator Action project in Xcode, the project template supplies an AMShellScriptAction instance as File’s Owner of the action bundle. This ready-made instance provides a default implementation of the AMActionrunWithInput:fromAction:error: method that uses the logic defined in the script. You can substitute your own subclass of AMShellScriptAction for File’s Owner if you need to.
Instance Methods
inputFieldSeparator
Returns the character that is used as the delimiter between items in the string passed in through standard input.
Discussion
The Automator framework converts the output from the previous action (which is usually in the form of a list or array) into a single string in which the array elements are concatenated by the input field separator. By default this separator is the newline character (@”\n”). You could, for example, override this method to return a null character (@”\0”) to provide null-terminated strings for xargs -0.
Availability
- Available in OS X v10.4 and later, Xcode 2.1 and later.
Declared In
AMShellScriptAction.houtputFieldSeparator
Returns the character used as a delimiter in the string output of the receiver.
Discussion
The Automator framework converts this string into an array (or list) whose elements are derived from the fields delimited by the separator character, and then passes the array (or list) to the next action in the workflow. The default value is the separator character returned by inputFieldSeparator. Override this method if you want a different delimiter for output.
Availability
- Available in OS X v10.4 and later, Xcode 2.1 and later.
Declared In
AMShellScriptAction.hremapLineEndings
Returns whether you want automatic remapping of carriage return (\r) to newline (\n) characters in the input string.
Discussion
The default is NO. Override to return YES if you want the remapping to occur.
Availability
- Available in OS X v10.4 and later, Xcode 2.1 and later.
Declared In
AMShellScriptAction.h© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-10-26)