NAME

File::Spotlight - List files from Smart Folder by reading .savedSearch files

SYNOPSIS

use File::Spotlight;

my $path = "$ENV{HOME}/Library/Saved Searches/New Smart Folder.savedSearch";

my $folder = File::Spotlight->new($path);
my @found  = $folder->list();

DESCRIPTION

File::Spotlight is a simple module to parse .savedSearch Smart Folder definition, run the query and get the results with OS X Spotlight binding via Mac::Spotlight.

This is a low-level module to open and execute the saved search plist files. In your application you might better wrap or integrate this module with higher-level file system abstraction like IO::Dir, Path::Class::Dir or Filesys::Virtual.

METHODS

new
$folder = File::Spotlight->new("/path/to/foo.savedSearch");

Creates a new File::Spotlight object with the .savedSearch file path usually in ~/Library/Saved Searches folder.

list
@files = $folder->list;

Executes the saved Spotlight query and returns the list of files found in the smart folder.

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Mac::Spotlight::MDQuery http://www.macosxhints.com/dlfiles/spotlightls.txt