I am using a WebView in my app to view individual pdfs that are located on web servers where I work. I’ve gotten it working (the pdfs open using the PDF Viewer plugin), but something annoying keeps happening: Under a number of circumstances (typically after re-launching==but not always), it seems to forget what helper application to use and prompts me to locate a viewer (I choose the Acrobat Reader 8 application). I would like this choice to be stored so the user isn’t constantly burdened with re-selecting the helper ap.
I’ve been using Applescript Studio on & off for a while, but this is my first use of the webview, and I would have assumed it would just honor the mime settings on the Mac. I do have Default Apps prefpane (RCDefaultApp) installed and can verify that Acrobat Reader 8 is the default for “application/pdf” but the webview just doesn’t seem to recognize that.
In checking the Cocoa docs for webView I notice the registerViewClass:representationClass:forMIMEType: method. But I’m not a Cocoa programmer, so I’m not sure whether that’s what I need or how to use it. I’m hoping someone could provide assistance in that direction.
Although, while checking online, I see there’s also an extra PDFKit.palette that can be added to Interface Builder. I was thinking of trying that as well, but I can’t find any example that use that in applescript studio. Also, my guess is that would use Apple’s PDF viewer engine (Preview) which would work, but Acrobat Reader 8 would be my preference.
Anyone?
Model: iMac G5
AppleScript: AS Studio/XCode 2.1
Browser: Safari 3.1
Operating System: Mac OS X (10.4)