AppleScript and Searching Files

I have some files that have mixed Traditional Chinese and English text. I don't want to go through the pain of manually selecting all the Traditional Chinese text and then going to TextEdit > Services > ChineseTextConverter > Convert Selected Traditional Chinese Text.
How can I write an AppleScript that opens the file, searches for Chinese Text, converts it, and then saves the changes?

thestinger wrote:
If you just want to search using filenames, there's nothing wrong with locate and find.
If you want to search using metadata from files, content in the files, etc. then you'll have to use something like tracker, strigi or beagle.
find is fine if you don't have many files or know approximately where the file you're looking for is located, but when searching through 3TB of stuff with a partial filename it's gonna slow since there's no search index.
Also it would be better if I had a simple gui.
There's mainly 2 things I like about Everything and would like to find a linux search program that works in a similar way
-Search index, that is built extremely fast. Also it monitors changes and adds/removes from the index on the fly. (search results appear instantly because of this)
-It searches in a similar way like when you're searching the media library in most music players (e.g. itunes, rhythmbox, foobar). It starts by showing every file and folder on the computer then narrows down the results with each letter you type.

Similar Messages

  • Indexing and searching files on linux

    I have been using this program called Everything on Windows.
    Which is the most awesome desktop search program I have ever encountered btw. It's just clean, simple and efficient
    I can never remember where any of my files are so I really need something similar for linux.
    You guys know of anything like this?

    thestinger wrote:
    If you just want to search using filenames, there's nothing wrong with locate and find.
    If you want to search using metadata from files, content in the files, etc. then you'll have to use something like tracker, strigi or beagle.
    find is fine if you don't have many files or know approximately where the file you're looking for is located, but when searching through 3TB of stuff with a partial filename it's gonna slow since there's no search index.
    Also it would be better if I had a simple gui.
    There's mainly 2 things I like about Everything and would like to find a linux search program that works in a similar way
    -Search index, that is built extremely fast. Also it monitors changes and adds/removes from the index on the fly. (search results appear instantly because of this)
    -It searches in a similar way like when you're searching the media library in most music players (e.g. itunes, rhythmbox, foobar). It starts by showing every file and folder on the computer then narrows down the results with each letter you type.

  • Ultra Search / File system

    Hi again,
    I'm developing a document management application and now i'm storing files on the local file system with an structure of folders and subfolders created by me. Now, I want to add functionality of searching documents by content and so, I thought in using Ultra Search. My doubt is what shall I do because I don't want to store files in the database because i would mean to redefine the lowest layer of my application and, obviously, I can't. So, my answer is: Is there a way of having a "pointer" to each file in order to return this identifier every time that I do a search of files containing a certain word? The pointer could be a foreign key to another table with information of how to locate the file.
    I hope it would be clear! :)
    Thanks a lot,
    Jordi
    Thank you very much!

    Jordi
    Now, I want to add functionality of searching
    documents by content and so, I thought in using Ultra
    Search. My doubt is what shall I do because I don't
    want to store files in the database because i would
    mean to redefine the lowest layer of my application
    and, obviously, I can't.With Ultra Search you can directly index and search files stored on the file system. I.e. you don't need to have them in the database.
    HTH
    Chris

  • Using Automator and Applescript to search and move files to flash drive

    I've used applescript and automator to do simple tasks like watch folders and move files and rename files, but that is about the extent. I am wondering if it is possible to set up a automator service or app that will do several things.
    When a flash drive is plugged it, it will ask for a file to be searched for, then it will search a predetermined directory for files with the word or number in them and then it will copy the found files to the mounted flash drive.
    Any help would be greatly appriciated!
    Thanks!

    As a start, you can use launchd to run a script when a volume is mounted:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>com.tonyt.LaunchOnVolMount</string>
              <key>ProgramArguments</key>
              <array>
                        <string>LaunchOnVolMount.sh</string>
              </array>
              <key>QueueDirectories</key>
              <array/>
              <key>StartOnMount</key>
              <true/>
              <key>WatchPaths</key>
              <array/>
    </dict>
    </plist>
    You can then have the LaunchOnVolMount.sh script perform the tasks you need.
    You can incorporate Applescript within the Bash script with osascript:
    #!/bin/bash
    answer=$( osascript -e 'tell app "System Events" to display dialog "What file do you want to search for?" default answer "" ' )
    echo $answer
    I beleive that you can also call an Applescript from launchd

  • Using Applescript and Automator to manage files and folders

    Hi all.
    I need to make a simple action via applescript and-or automator to take the file it's been applied to (via the services) create a folder around it with the same name as the file.
    So far, I've searched the web, found some solutions but none are really working.
    Here's the script I found :
    set myFolder to findFolder()
    tell application "Finder" to set myFiles to files of myFolder as alias list
    repeat with aFile in myFiles
      set bName to my baseName(aFile)
      tell application "Finder"
      set folderExists to exists folder bName of myFolder
      if not folderExists then make new folder at myFolder with properties {name:bName}
      move aFile to folder bName of myFolder
      end tell
    end repeat
    ---------------- HANDLERS ----------------
    on baseName(myFile)
      tell application "System Events" to set {fileName, fileExt} to {name, name extension} of myFile
      return text 1 thru ((get offset of "." & fileExt in fileName) - 1) of fileName
    end baseName
    on findFolder()
      activate application "SystemUIServer"
      -- Bug pointed out by Lauri Ranta http://www.openradar.me/9406282
      tell application "Finder"
      activate
      set mySelection to (get selection)
      if mySelection ≠ {} then
      set mySelection to first item of (get selection)
      if mySelection's class = folder then
      set currentFolder to mySelection
      else if mySelection's class = document file then
      set currentFolder to parent of mySelection
      else if mySelection's class = alias file then
      set currentFolder to original item of mySelection
      end if
      else
      set currentFolder to target of front Finder window
      end if
      end tell
      return (currentFolder as alias)
    end findFolder
    And here's a page where they explain how to use automator and the Services to do what I <allmost> want, with some adaptation.
    But it still doesn't work.
    http://hbase.net/2011/08/17/move-selected-files-into-a-new-folder-using-applescr ipt-and-automator/
    So if anybody has an idea n how I could do this ?
    It It could either be a folder action (I drag and drop the files into a folder and boom, they get their folder around them)that I would set on a folder on a network drive, or locally, it doesn't matter, or a service (right clic on the file and boom folder around it.
    So if anyone could help with this I'd be grateful...

    Hi,
    Make an Automator Service (Service receives selected "Files or Folders"  in the "Finder.app").
    Use this script in the "Run AppleScript" action:
    on run {input, parameters}
        tell application "Finder"
            repeat with aFile in input
                if class of (item aFile) is not folder then
                    set {tName, fileExt} to {name, name extension} of aFile
                    if fileExt is not missing value and fileExt is not "" then
                        set tName to text 1 thru -((count fileExt) + 2) of tName
                        tell (get container of aFile)
                            if not (exists folder tName) then make new folder at it with properties {name:tName}
                            move aFile to folder tName
                        end tell
                    end if
                end if
            end repeat
        end tell
    end run
    This script work on files with a name extension.

  • In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    Thanks for chipping in.   I discovered something after trying what you suggested.   I have quite a few collections of hits by year from Time Life and Billboard.  I've eliminated duplicate tracks that appear in both collections (or other CDs for that matter), but cross-reference the CD where I deleted the track and placed in in the comments section of the CD track I retained.   If I "search" by song name, only the remaining track appears.   But if I want to hear for example Classic Rock 1964, only those tracks remaining would be there when I pull up that CD.   So, I type "Classic Rock 1964,"  in the search field.  First the boxes on the right of the screen open up showing album icons.  Showing four tracks by album with a button to view 10 more, then four songs with an option to vies 18 more.   I finally noticed that at the top of the boxes is a blue band that reads, :Show Classic Rock 1964 in Music.  When I double click on this blue band, all 24 tracks from the original CD appear in the song list format even though I had deleted two of them because they appeard in a Beach Boys CD.   On those tracks, I had referenced Classic Rock 1964 in the comments field.    So, bottom line, Search will also look in the comments field if you click "filter by all" in the magnifying glass to the left of the search field.   And you can move all tracks that if finds into a song list by double clicking on the blue band.

  • Attempting to upgarde itunes and I get an error message looking for "an alternate path to a folder containing 'iTunes.msi' location.  I've searched my hard drive and the file doesn't exist.  What to do?

    Attempting to upgarde itunes and I get an error message looking for "an alternate path to a folder containing 'iTunes.msi' location.  I've searched my hard drive and the file doesn't exist.  What to do?

    This worked...found on a prior discussion:
    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page)...
    http://majorgeeks.com/download.php?det=4459
    From the link above (near the top of the page)....Under 'download locations'   click on 'download@majorgeeks'
    To install the utility, doubleclick the msicuu2.exe file you just downloaded and ran.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Restart your computer.
    Re-download Itunes (latest version form Itunes website) and install.  It worked!

  • Appending objects in text file and searching.......

    I have been trieng to implement simple search operation on the class objects stored in the text file. but when i try to append new objects in the same file and search for the same; java.io.StreamCorruptedException is thrown. wat the problem is, that wen i append to the text file; it stores some header information before the actual object is stored and on the deserialization, this header information is causing the exception. the same header information is stored every time, i append to the file. anybody knws hw to get past it??? my code is as given below:
    package coding;
    import java.io.BufferedReader;
    import java.io.EOFException;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.PrintWriter;
    import java.io.Serializable;
         class Employee implements Serializable{
              private static final long serialVersionUID = 1L;
              String name;
              int id;
              public int getId() {
                   return id;
              public void setId(int id) {
                   this.id = id;
              public String getName() {
                   return name;
              public void setName(String name) {
                   this.name = name;
              public Employee(String name, int id) {
                   this.name = name;
                   this.id = id;
         public class FileSearch{
         public static void main(String[] args) throws IOException
              /*Entering the records into the file*/
              Employee ob = null;
              File file=new File("c:\\abc.txt");
              InputStreamReader isr=new InputStreamReader(System.in);
              BufferedReader stdin=new BufferedReader(isr);
              char fileExist='y';
              if(file.exists())
                   System.out.println("File already exists!!!");
                   System.out.println("Append New Records(press y) Or Search Existing File(press any other button)?:");
                   String strTemp=stdin.readLine();
                   fileExist=strTemp.charAt(0);
              else
                   System.out.println("File doesnt exist; creating new file......");
              if(fileExist=='y')
                   FileOutputStream fos=new FileOutputStream(file,true);
                   ObjectOutputStream oos=new ObjectOutputStream(fos);
                   char choice='y';
                   System.out.println("Enter records:");
                   while(choice=='y')
                        System.out.println("enter id:");
                        String id_s=stdin.readLine();
                        int id=Integer.parseInt(id_s);
                        System.out.println("enter name:");
                        String name=stdin.readLine();
                        ob=new Employee(name,id);
                        try
                             oos.writeObject(ob);
                             //count++;
                             oos.flush();
                        catch(Exception e)
                             e.printStackTrace();
                        System.out.println("Enter more records?(y/n)");
                        String str1=stdin.readLine();
                        choice=str1.charAt(0);
                   oos.close();
              /*Searching for the record*/
              System.out.println("Enter Record id to be searched:");
              String idSearchStr=stdin.readLine();
              int idSearch=Integer.parseInt(idSearchStr);
              try
                   FileInputStream fis=new FileInputStream(
                             file);
                   ObjectInputStream ois=new ObjectInputStream(fis);
                   int flag=1;
                   FileReader fr=new FileReader(file);
                   int c=fr.read();
                   for(int i=0;i<c;i++)
                        Object ff=ois.readObject();
                        Employee filesearch=(Employee)ff;
                        if(filesearch.id==idSearch)
                             flag=0;
                             break;
                   ois.close();
                   if(flag==1)
                        System.out.println("Search Unsuccessful");
                   else
                        System.out.println("Search Successful");
              catch(Exception e)
                   e.printStackTrace();
    }

    966676 wrote:
    All what I need to elect by who this word repeated. But I don't know really how to make It, maybe LinkedListYou should choose the simplest type fullfilling your needs. In this case I'd go for <tt>HashSet</tt> or <tt>ArrayList</tt>.
    or I dont know, someone could help me?You need to introduce a variable to store the actual name which must be resetted if an empty line is found and then gets assigned the verry next word in the file.
    bye
    TPD

  • Search multiple folders and muiltiple files and combine to single file

     I want to search multiple folders for muliple files and combine to single file name. The files I'm searching have same format, but where named
    differently in each of there processes. Now I want to combine based upon -SearchFor .. I'm having a problem with -Filter $SearchFor
    Code:
    Function Search-Files{
    Param([String[]]$Locations,[String[]]$SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\servera\public\t1\usa\saleshist\","\\serverb\public\t2\usa\saleshist\",-SearchFor "dodetail-cm.txt","somstr.txt",-AppendTo "\\virt1\Saleshist_data_load_files\saleshdr.load.csv"

    I think you might want to use -Include instead of -Filter.  Your -Include parameter accepts wildcards, i.e. *.docx or *somstr.txt
    Your command to actually append the content should be:
    Get-Content -Path $File.FullName | Out-File $AppendTo -Append
    You had $Files.FullName which might behave unexpectedly, if at all.
    Your actual command has several issues.
    Search-Files -Locations "\\servera\public\t1\usa\saleshist\","\\serverb\public\t2\usa\saleshist\" -SearchFor "dodetail-cm.txt","somstr.txt" -AppendTo "\\virt1\Saleshist_data_load_files\saleshdr.load.csv"
    You had commas following the lists of locations and searchfor terms, did that even work? Without seeing your source files or your target file I can only advise you so much, but ideally you would import-csv and export-csv.  Depending on the contents,
    you may be able to get away with get-content and out-file though.
    I hope this post has helped!

  • Problem with Searching file and writing

    Hi guys,
    i m writing a program to search for a file and if the file exists it will write .
    otherwise printing astatement saying file not found.
    i m passing directory name as an argument.
    in tht there are many ip files.
    the program will search for a particular file in all the zip files.
    i m passing arguments are
    <directory-name> <search-file-name>
    the code is finding the particular file but its not writing to another file.
    i m getting exception as Filenot found.. the code as follows:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Enumeration;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    import java.io.*;
    public class SearchFile {
    public static void main(String args[]) {      
         try{
         Testme(args[0],args[1]);
         catch(Exception e){System.out.println(e);}
    public static void Testme(String lists,String sfile)
         File dir = new File(lists);
    File[] children = dir.listFiles();
         int length =children.length;
    if (length < 0) {
    System.out.println("sorry No files found");
    } else {
    for (int i=0; i<length; i++) {
    // Get filename of file or directory
    File fl=children;
              System.out.println("the File name is "+fl.getName());
                        if(fl.getName().endsWith(".zip"))
                   //System.out.println("The zipped files are"+filename);
                   SearchZip(fl,sfile);
    public static void SearchZip(File zipfile,String searchfile)
              //System.out.println("welcome"+zipfile);
              boolean state=false;
    try {
         int count=0;
              ZipFile zf = new ZipFile(zipfile);
              System.out.println("----------------------------");
              System.out.println("Searching in "+zipfile);
              Enumeration entries = zf.entries();
              //System.out.println("the passed file File name is "+args[1]);
              while (entries.hasMoreElements()) {
              ZipEntry ze = (ZipEntry) entries.nextElement();
              System.out.println("----------------------------");
              System.out.println("Listing FIles " + ze.getName() );
              String files=ze.getName();
              System.out.println("----------------------------");
              File f = new File("geetha.txt");
              byte[] buf = new byte[8184];
              String inputLine = "y";
              if (inputLine.equalsIgnoreCase("y")) {
                   long size = ze.getSize();
                   if (size > 0) {
                        System.out.println("name is " files "size is"+ size);
                        BufferedReader br = new BufferedReader(
                             new InputStreamReader(zf.getInputStream(ze)));
                        String line;
                        if(files.equals(searchfile))
                             System.out.println("File Found...............");
                             FileInputStream in = new FileInputStream(files);
                             FileOutputStream out = new FileOutputStream(f);
                             int len;
                        while ((len = in.read(buf)) > 0) {
                             state=true;
                        out.write(buf, 0, len);
                        System.out.println("successfully Written the file");
                        System.out.println("The File Found is "+state);
              catch (Exception e) {
              System.out.println("File Not Found Please check the File"+e);

    This is a multipost of http://forum.java.sun.com/thread.jspa?threadID=692507&tstart=0
    Please return to that thread Santhosh as you have been given a couple of answers already in that thread.

  • Indexing and Searching PDF Files

    Hi All,
    I am trying to store and search PDF files in the oracle database.
    I can insert and index the PDF files just fine but cannot get any result. I always get No Rows.
    Here's what I am doing and the issues I am facing.
    I created a Table with fields
    ID (VARCHAR)
    NAME (VARCHAR)
    DOC (BLOB)
    I inserted the PDF file in the BLOB field through a Java program and insert worked fine as I verified by retreiving the PDF and writing to file.
    I created index using following SQL:
    create index my_index on PDF_TABLE(PDF_FLD) indextype is ctxsys.context
    parameters ('datastore ctxsys.default_datastore
    filter ctxsys.inso_filter');
    The index was created successfully without any problems.
    I ran query as follows and got no rows although the searched text is in PDF
    SELECT SCORE(1), PDF_FLD from PDF_TABLE WHERE CONTAINS (PDF_FLD, 'Table of Cotents',
    1) > 0;
    I tried alternate queries as well with no luck.
    Any ideas ??
    Thanks

    After creation the index you need execute next operations.
    first, check that your index tables conatins indexed terms. Execute
    select token_text from dr$YOUR_INDEX$i;
    Second, you will need to check the index errors table CTX_INDEX_ERRORS. This is owned by the user CTXSYS, and most users do NOT have # SELECT privilege to it by default.
    If it's OK, then check that your PDF documents is supported by INSO filter.
    Citation:
    "PDF - Portable Document Format
    Acrobat Versions 2.1, 3.0, 4.0, and 5.0 including Japanese PDF"
    (Appendix B. Supported Document Formats in Oracle Text Reference 9.2)
    For Oracle 9i you could install 9.2.0.4 patchset (it included INSO FILTER 7.5)
    P.S.
    for the beginning, you could find answers for your question about Oracle Text here
    http://otn.oracle.com/products/text
    Sorry for my English.
    Best regards, Victor Zogin.

  • What is the name of the folders which are your backup of Itunes library? I am recovering from a virus, have no workable desktop in Win XP, but can search and find files and folders. I would like to move these backup files to a new computer

    what is the name of the folders which are the backup of Itunes library? I am recovering from a virus, have no workable desktop in Win XP, but can search and find files and folders. I would like to move these backup files to a new computer, authorize it and sync with Iphone 3Gs and Ipod 5th gen.
    I

    I second the whole iTunes folder approach.
    If for some reason you have split the media folder from the library files then the media folder needs to restored to the same path it used to have while the library files can be copied into the music folder of your new profile.
    If in dobut, backup up the entire Documents and Settings folder before wiping the infected drive, but be selective about what you restore as many viruses drop active components capable of reinfecting the compuer in the temp folders and internet caches. It is much easier to backup more than you need than to discover after the fact that you no longer have access to some vital project you'd been storing in a folder on the desktop.
    tt2

  • A way to search System Files and by File Name as default?

    Hello.
    Is there a way I can make the default search both include searching by File Name and searching System Files?
    I know I can make a saved search, but this just is one extra step. I'd like to the default behavior of the Finder be to search system files, and default to searching by File Name rather than contents.
    Thanks.

    If you bring up the Finder window search using Command-Shift-F you will get the default of a file name search (unfortunately it has no criteria whatsoever, so if you want to modify the search with an added criterion you have to click the wee little + icon).
    There is no way to automatically include system files.
    Francine
    Francine
    Schwieder

  • Creating and Searching index files

    Hi,
    This is my first posting so apologiese in advance if it is difficult to understand.
    Firstly, I am from a development background of some 6 years (c#, asp.net, vb.net, SQL) so i have a solid grounding and am happy to give any new development a try.
    I have a client who has 10,000's of scanned pdf documents but no real way of retrieving and searching these documents.  In fact another person in my team is involved in making sure these pdfs are searchable by doing some OCR and rescanning work.  I have been asked to come up with a way to allow client to retrieve(open) and search the pdf files.
    Here is what i am proposing based on what I have leared about Acrobat Pro 9 and Adobe Reader 8/9.
    I actually want to do a lot more than above but think that is enough to get me started.  In a nutshell the client would like a web based solution to search and retrieve (open) there scanned pdf documents.  I have read on other posts in the forum an understand it can be quite difficult to search pdf's (pdx file) from Internet Explorer.
    As a start i had the following tasks in mind as needing completed:
    Task 1 - Create directory structure on file server for all the scanned pdfs.  Create catalog(s) for these documents and then create an index which creates a .pdx file.  Given the number of documents it looks like I will have X number of catalogs and X number of pdx files.
    Task 2 - create a web application that allows a tree view to be displayed that replicates the directory structure above so a user can open the pdf from the browser.
    Task 3 - I know the users can use Adobe Reader advanced find functionality and select the indexes i have created.  However, I would like to create a plugin for Adobe Reader that will load all of the indexes into the selectable index list and select all by default.  Given the volume of documents it is likely the user will not know exactly what they are looking for so will need to search across all indexes.
    Thanks in advance for any help anyone can provide me in getting started with these tasks.

    Some links that may be helpful.
    Acrobat Developer Center:
    http://www.adobe.com/devnet/acrobat.html
    Forums:
    Acrobat SDK
    http://forums.adobe.com/community/acrobat/acrobat_sdk
    Acrobat Scripting
    http://forums.adobe.com/community/acrobat/acrobat_scripting
    Various topic specific forums at the AUC
    http://acrobatusers.com/forum
    Be well...

  • Spotlight/Finder Doesn't Search In ASP and other file types?

    .asp and .c file types are nothing more than .txt files with different extentions..
    Am I correct in thinking that Spotlight doesn't search inside these files? I have a folder full of asp files and spotlight doesn't seem to find anything when I type text that I know is inside one (as a test)
    It does appear to search INSIDE .html files in the same folder.. Can you add different file extentions that spotlight will search into?
    If not, then "Spotlight" is much ado about nothing as google desktop search, X1 and the msn desktop search (Windows) released years ago search inside ALL files..
    Signed,
    Curious Switcher
    Wayne Bienek
    Mac Pro 3Ghz / 4GB Ram Mac OS X (10.4.8) 30" Cinema Display + 20 " Cinema Display

    Spotlight makes a content index for files using mdimporter, and that process depends on mdimporter modules for the specific file type. Thus in /Library/Spotlight you will see a collection, such as Microsoft Office.mdimporter, of "extras" for special file types. There are also the built-in ones in /System/Library/Spotlight. If you installed Xcode/Developer Tools, there should be a SourceCode.mdimporter, which I imagine would index the asp and c files. If not, some people have modified it to also index php files, see this discussion:
    http://www.macosxhints.com/article.php?story=20050514182520714&query=spotlight%2 Bphp%2Bfiles
    at MacOSXHints. I think you could do something similar (at your own risk of course) for other pure text based files. Be sure to expand the the replies and read them.
    Francine
    Francine
    Schwieder

Maybe you are looking for