Bellhop Perl Extension Module
Overview
The Bellhop Perl Execution Context plug-in provides a custom Perl extension module that is automatically made available to any Perl services managed by Bellhop. The module contains three packages: Pasteboard, Panel and Finder. You do not have to do anything special to use the methods in these packages—they are automatically loaded into all Bellhop Perl services when the are executed, however you must use the fully qualified name of each function in its respective package. Each of these packages allow your services to interact with the Mac OS X services system from within your scripts. You can use them as you would any other Perl package.
The Pasteboard Package
The Pasteboard package defines functions that allow you to query the services pasteboard for its contents, as well as put data back onto it. It mimics the methods of NSPasteboard class in the Cocoa frameworks, with some differences. The most notable difference is that all methods in the module take the name of the pasteboard that is to be queried or altered. Additionally, all of the global constants that are used to define pasteboard types are available to your Perl services using the same symbolic names as defined in the Cocoa frameworks (e.g. NSStringPboardType).
The Panel Package
The Panel package defines functions that you can use to interact users with users using panels and dialogs. You can choose from prompt panels, alert panels, list selection dialogs and file open/save dialogs. In addition to the functions to create the panels and dialogs, there are a few global constants that are defined to indicate the return values for some of the dialog box panels. These constants mimic those defined in the Cocoa frameworks (e.g. NSAlertDefaultReturn).
The Finder Package
The Finder package defines functions that you can use to interact with the Finder in a limited fashion. It defines functions to select files, launch applications, open documents and URLs, and move/copy files.