SQL Quicklook Plugin

Discussion in 'Mac Programming' started by anonmill, Feb 20, 2008.

  1. macrumors member

    anonmill

    Joined:
    Aug 29, 2007
    #1
    I don't know if this is the right forum to post this in, but does anyone know of a SQL Quicklook Plugin? I am not after anything fancy, even just showing the text of a *.sql file would be good. Anything beyond that would be gravy (i.e. syntax highlighting). I have looked around some, but haven't found anything. I found some great ones for Zip files, Java files, etc. though.

    I have some programming experience, though none for native Mac stuff. Is it hard to write one that would just grap the text from the file and show it?

    Thanks!
     
  2. macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #2
  3. thread starter macrumors member

    anonmill

    Joined:
    Aug 29, 2007
    #3
    Thank you!!

    Following those instructions appears to have worked. In fair warning to others who may come across this however, I have done little testing beyond seeing that it worked initially. So I don't know yet if there are any crazy side affects. If anyone is interested, I followed the instructions but used TextWrangler. I added this to the Info.plist:

    Code:
     <key>UTExportedTypeDeclarations</key>
      <array>
        <dict>
          <key>UTTypeConformsTo</key>
          <array>
            <string>public.text</string>
            <string>public.plain-text</string>
          </array>
          <key>UTTypeDescription</key>
          <string>SQL Code</string>
          <key>UTTypeIdentifier</key>
          <string>com.barebones.textwrangler</string>
          <key>UTTypeTagSpecification</key>
          <dict>
            <key>com.apple.ostype</key>
            <string>TEXT</string>
            <key>public.filename-extension</key>
            <array>
              <string>sql</string>
            </array>
          </dict>
        </dict>
      </array>
    Immediately before:

    Code:
    </dict>
    </plist>
    I then issued this from terminal to make the changes take affect:

    Code:
    touch /Applications/TextWrangler.app
     
  4. macrumors newbie

    Joined:
    Jul 23, 2008
    #4
    Watch for competing (and now dead) apps being engaged by QuickLook

    Head's up. I was trying to get TextMate to handle some SQL file types like .sql, .pks and .pkb (those last 2 are specific to Oracle). I could get .pks and .pkb to get recognized by QuickLook, but not .sql.

    Turns out, at some point I tried out Froq. I deleted the app, but not some of the other files associated with it. QL was trying to engage Froq to handle .sql, not TextMate. All I saw was a generic QL icon for .sql files. After I deleted the final remnants of Froq, QL started using TextMate. All's well.

    Peace.
     

Share This Page