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



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 and get the result by executing the Spotlight query by mdfind command.

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 the IO::Dir manpage, the Path::Class::Dir manpage or the Filesys::Virtual manpage.


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

http://www.macosxhints.com/dlfiles/spotlightls.txt

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