Posted on 04-07-2011 07:31 AM
----- Forwarded Message -----
Posted on 04-21-2011 08:45 AM
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
Posted on 04-21-2011 09:19 AM
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
Posted on 04-21-2011 10:17 AM
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.
Posted on 04-21-2011 11:03 AM
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.
Posted on 04-21-2011 11:20 AM
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.