Bellhop Python Extensions Reference
Overview
The Bellhop Python Execution Context plug-in provides three custom Python extensions that are automatically made available to any Python services managed by Bellhop: pasteboard, panel and finder. You do not have to do anything special to use the methods in these modules—they are automatically loaded into all Bellhop Python services when the are executed. Each of these extensions 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 Python extension.
The pasteboard Extension
The pasteboard extension 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 Python services using the same symbolic names as defined in the Cocoa frameworks (e.g. NSStringPboardType).
The panel Extension
The panel extension 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 Extension
The finder extension 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.