Bellhop Finder Package for Perl Reference

 

Overview

The Finder package defines functions that you can use to interact with the Finder in a limited fashion. It defines functions to select files in the Finder, launch applications, open documents and URLs, and move/copy files.

 

Method List for finder Extension

The following methods are available in the finder extension:

NOTE: Each function is shown with the arguments that are expected when invoking the function. For functions that require strings and numbers you can pass normal scalar values, however for arrays and hashes you must pass in references. Similarly, numeric and string return values are returned as scalars, however arrays and hashes are returned as references. Array and hash references can contain nested structures.

 

Method Descriptions for 'Finder' Package

Finder::select_file(aFile, aPath)
Selects aFile in a Finder window. If aPath is not None, then a new Finder window is created rooted at the path aPath. If it is None, then the main Finder window is used. Returns True if the operation was successful, False otherwise.

 

Finder::open_file(aFile, anApp)
Asks the Finder to open aFile (which should be a fullpath to a file) using the application identified by anApp. anApp need not be a full path to an application, nor does it have to have the ".app" extension. Returns True if the operation was successful, False otherwise.

 

Finder::open_url(aURL)
Asks the Finder to open aURL. Returns True if the operation was successful, False otherwise. Note that you can specify any type of URL (e.g. a "mailto" url will open the user's mailer to send an email).

 

Finder::move_files(someFiles, srcDir, dstDir)
Asks the Finder to move the files in the someFiles list from the source directory srcDir to the destination directory dstDir, both of which are specified as strings. Note that the filenames should be given relative to the source directory, and the destination directory must already exist. Returns True if the operation was successful, False otherwise.

 

Finder::copy_files(someFiles, srcDir, dstDir)
Asks the Finder to copy the files specified in the someFiles list from the source directory srcDir to the destination directory dstDir, both of which are specified as strings. Note that the filenames should be given relative to the source directory, and the destination directory must already exist. Returns True if the operation was successful, False otherwise.

 

Finder::recycle_files(someFiles, srcDir)
Asks the Finder to move the files specified in the someFiles list to the trash. The files should be given relative to the source directory srcDir. Returns True if the operation was successful, False otherwise.

 

Finder::delete_files(someFiles, srcDir)
Asks the Finder to permanently delete the files specified in the someFiles list. The files should be given relative to the source directory srcDir. Returns True if the operation was successful, False otherwise. Note that this operation is immediate, and cannot be undone.

 

Finder::launch_application(anApp)
Asks the Finder to launch the application anApp. anApp does not have to be a full path, nor does it need the ".app" extension. Returns True if the operation was successful, False otherwise.