Fw: Setting Safari to open tiff's in preview.app

bentoms
Release Candidate Programs Tester

----- Forwarded Message -----

5 REPLIES 5

bentoms
Release Candidate Programs Tester

Hi guys,

I still can't get Safari to not open tiffs, but have found i can set Firefox to open tiffs in preview by changing the following line in Firefox's prefs.js file.

Opens tiff in preview: "user_pref("plugin.disable_full_page_plugin_for_types", "image/tiff");

Tiffs open in firefox(default): user_pref("plugin.disable_full_page_plugin_for_types", "");

Now i'm having issues scripting this change, i don't want to modify the firefox.app but instead have an applescript app that loads the url i need in firefox but before it does so it checks to see if the above is set & if not sets it.

When i try using the below echo script it strips out the "", is there a better way of doing it?

echo "user_pref(""plugin.disable_full_page_plugin_for_types"", ""image/tiff"");" >> ~/Library/Application Support/Firefox/Profiles/*.default/prefs.js

Not applicable

You need to use backslashes to escape that stuff. Try this:

echo "user_pref("plugin.disable_full_page_plugin_for_types", "image/tiff");" >> ~/Library/Application Support/Firefox/Profiles/*.default/prefs.js

However, if you run that as root (as Casper does), it will not do what you expect; you'll need to switch users first. Or, better yet, run it for all users:

for f in /Users//Library/Application Support/Firefox/Profiles/.default/prefs.js
do echo "user_pref("plugin.disable_full_page_plugin_for_types", "image/tiff");" >> "$f"
done

It's very likely that there's a better way to accomplish what you want. What exactly are you trying to do with all this?

On Apr 21, 2011, at 11:45 AM, Ben Toms wrote:

Hi guys,

I still can't get Safari to not open tiffs, but have found i can set Firefox to open tiffs in preview by changing the following line in Firefox's prefs.js file.

Opens tiff in preview: "user_pref("plugin.disable_full_page_plugin_for_types", "image/tiff");
Tiffs open in firefox(default): user_pref("plugin.disable_full_page_plugin_for_types", "");

Now i'm having issues scripting this change, i don't want to modify the firefox.app but instead have an applescript app that loads the url i need in firefox but before it does so it checks to see if the above is set & if not sets it.

When i try using the below echo script it strips out the "", is there a better way of doing it?

echo "user_pref(""plugin.disable_full_page_plugin_for_types"", ""image/tiff"");" >> ~/Library/Application Support/Firefox/Profiles/*.default/prefs.js

bentoms
Release Candidate Programs Tester

Thanks Benjamin. That worked!!

It's for a web based financial app that displays PO's in tiff format. Below is the idea of what I'm doing, i've had to do this before for another financial app that required safari with the pop-up blocker disabled.

So it looks like I can't change safari to open tiffs in preview so it can see more than one page.

Firefox, can be changed though. So the plan is:

Create an applescript app that will sit in the dock & have the epayables icon.

User click this, the app then checks to see if firefox is installed, if it's not it will prompt the user to install & will quit the app.

Once the above check has been passed (I.e firefox is installed) the setting to view tiffs in Preview instead of Firefox is ticked. If not it ticks it.

If it's not ticked & firefox is open it will prompt the user to close firefox. It'll then make the change to firefox.

Once the above has been done, the app will launch firefox to the epayables url.

So that's an applescipt, that uses some bash script to write some java script to tell applescript to open the link!

Regards,

Ben.

Not applicable

Can Preview open an HTTP URL directly? That might be preferable, if you don't need an actual web browser. I think the 'open' command has a way to send a URL to an application.

bentoms
Release Candidate Programs Tester

They need to login to the web page to see the orders. They then click the link in the order to see the PO.

The site is java based, so it's not a normal link, it's more like action().

Opening the tiff in either firefox or safari will only show 1st page.

Regards,

Ben.