Go Back   The macosxhints Forums > OS X Help Requests > Applications



Reply
 
Thread Tools Rating: Thread Rating: 16 votes, 5.00 average. Display Modes
Old 11-28-2007, 11:53 PM   #1
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Question trouble changing default "open with" file type

My problem could be related to this post, so if you must move it over there, feel free to do so:

http://forums.macosxhints.com/showth...ith+file+types

After perusing that thread I followed the Firefox suggestions, but it does not really help me. I have files with extension .xif that I save to disk (using Firefox, many times, but not exclusively) and that I would like to open with Preview.app as default. They are simple fax image files. Faxes coming through an email fax service (faxwave.com) Originally they opened with HexEdit on this machine, which does not even work on such files. Somehow poking around over time, I must have associated them with QuickTimePlayer.app, which works to a degree, but it does not look as good. I want them to open in preview.app. There seems to be nothing I can do to change these file types as a general rule to open with Preview as the default. File -> Get Info -> Open With -> Change All, just does not work. Even as the system is asking me if I want to change all .xif files to open with preview.app and I <Continue> the open with drop down bar switches back to QuickTime as the default. The files do come in with a Quick Time image icon. It does appear that the Firefox downloading mechanism is already associating these files in some way, which is no doubt part of the problem.

(1) Is there nothing in the OS that allows me to override such default associations without regard to the browser involved ????


I noticed a lot of the other image files in the menu Firefox->Preferences->Content->File Types->Manage show as opening with QuickTime as the default.

I cannot even find an extension/image file type of .xif in the list, so I cannot seem to do anything with that particular file type with the browser.

(2) Can I write that extension into the list somehow? It does not appear so.

(3) Any other suggestions that might help? This is really frustrating. I should be the one determining what application opens what file on my system as the default. Thanks in advance, as always. I don't know what I would do without you guys out there. You are very helpful.

My Environment is PowerMac G5 1.8GHz, Mac OS X Version 10.4.11
bloozman is offline   Reply With Quote
Old 11-29-2007, 12:03 AM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
You should be able to set the file association to Preview for that file type - assuming that Preview advertises (in its Info.plist file) that it is able to handle files of that type.
If Preview does not indicate that it is able to handle such files, you could fix the problem by editing the embedded Info.plist file in the Preview application - I believe there was an article on the main macosxhints site about doing this - not too long ago I think, maybe within the last month or so.

You might download the 3rd-party preference pane "RCDefaultApp" (http://www.rubicode.com/Software/RCDefaultApp/) and use it to set the association.
__________________
hayne.net/macosx.html

Last edited by hayne; 11-30-2007 at 11:33 PM.
hayne is offline   Reply With Quote
Old 11-30-2007, 02:25 AM   #3
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Ah, the Great White Knight and Wizard, Hayne of Tintagel and Montreal has returned to give aid. Thank you, sir. No more selfless a Knight/Wizard of this realm exists. Look at his number of posts!! Amazing!

Preview does NOT advertise that it opens .xif files. However, it does do such just fine when summoned to do so. I tried editing Info.plist file in the Preview application following instructions from this thread, thinking that it might be what you were describing:
http://www.macosxhints.com/article.p...51104055843452

The suggestions were roughly the same approach as you were describing. I used a text editor and tried to copy a section of code for xif files that mimicked what I saw for tiff files. I added it as another step in the "list". However, I did not try the precise terminal command the article suggested. Instead, I shut down and restarted the machine, thinking that was the equivalent of the other alternative suggested by the article. A reset was the key point, I thought. However, I noticed now that the other alternative was ACTUALLY technically a "login/logout", and that may be a tad different in this Mac universe as far as resetting the machine goes to a reboot. My steps did not work, in any case, needless to say. :-(

Then despite seeing other users' comments suffering similar plights that using 3rd party software like RCDefaultApp did not work for them, I tried it anyway, to be thorough, since the Mighty Hayne suggested it, after all. It did not take long. I read the readme file for RCDefaultApp and followed the procedure and changed the preferences in preference pane to Preview.app as I wanted, and that failed, as well. (Sorry, Hayne, it seemed a reasonable approach to me, too.)

Then I searched even harder and found what I believe to be the "article on the main macosxints site about doing this" that Hayne hinted at (not from a forum thread):

http://www.macosxhints.com/article.p...ery=Info.plist

I followed this to the letter, of course substituting xif for the slightly different example of xml suggested in this article, and also deleted the changes I noticed in Property List Editor that I had made using the first method which had seemingly failed.

This time I followed the article's terminal command precisely which seemed to be accepted just fine. Once, again, to no avail.

Some of the authors suggested this... dare I say "bug" was not Apple's fault and is not a bug, but to me it's a bug in the sense that the Operating System does not allow one to decide what application opens what on the system, depending on whatever association the browser affiliates to the file as it comes in off the web???? The browser decides not the OS???? And this even after using the OS' mechanism for resetting such, and it's not a bug??? OK, so it's just a really bad flaw or weakness in the OS, then. How's that? And that is certainly Apple's fault.

As I mentioned in another thread: say what you will about buggy and glitchy Windoze, I have never faced this type of resistance to overriding extension file type "open with" commands/associations in my Windows environments. Score Two for Windoze. They are still way behind, but let's be objective here, Mac fanatics.

I have spent way too much time on this issue. Apple OS developers, you watching? You listening? Take a good hard look at this. It needs work. There are least five other user threads on this issue or a slight variation, that I saw in my one half day of looking at this. And the other users were quite frustrated, too. Fix it! I should not have to, and you know it! I am beginning to feel inclined that I should be paid by Apple for my QA work on this seemingly thorny issue.

Thanks for the suggestions to all the wonderful contributors, especially the Mighty Hayne of Tintagel who's always there for us. I am sorry I could not solve it.
bloozman is offline   Reply With Quote
Old 11-30-2007, 11:31 PM   #4
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
I think it is indeed necessary to run that 'lsregister' command (the Terminal command given in those macosxhints articles) or else use one of the 3rd-party utilities that can reset the "launch services" database. Otherwise the system won't notice the change you made to the Info.plist file - usually I think the system picks up on this info when a new app is installed or the first time a new app is run. I don't think it does this at login or at startup.

By the way, you know that you can just drag the file onto the application (e.g. Preview) icon in the Dock to open the file with that application - that's what I usually do.
__________________
hayne.net/macosx.html

Last edited by hayne; 11-30-2007 at 11:33 PM.
hayne is offline   Reply With Quote
Old 12-02-2007, 08:51 PM   #5
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Thumbs down

Quote:
Originally Posted by hayne
By the way, you know that you can just drag the file onto the application (e.g. Preview) icon in the Dock to open the file with that application - that's what I usually do.

Thanks, again, Hayne. I would be partially happy with this above solution, but even this is not working. Perhaps the file type association after the download renders this trick null and void??? I will paste the code of changes I have made into the next reply. I will run through that second terminal command, too, but I bet it will not work. There is something more fundamentally wrong with the Mac OS X. Getting an invalid file type would be one thing, but we know the file types I am trying to open work fine in Preview.app. They open in Preview.app. I am simply not able to get the "open with" and "change all" features to work on a file type that these settings should work on. Therein lies the flaw. Whatever code controls this feature, that is where we need to look. This is a fundamental flaw. Is there a way to send this in to Apple so that they know it's a problem? It's bothering me enough that I want them to know this is not working. Even if I figure this out, it's really irritating that it is requiring this level of attention and time.

I can easily make these types of changes, on my Windows 2000 machine, for heaven's sake with three clicks: a right click, a selection click and a checkbox click.
bloozman is offline   Reply With Quote
Old 12-02-2007, 09:04 PM   #6
cwtnospam
League Commissioner
 
Join Date: Jan 2005
Posts: 8,475
Quote:
Originally Posted by bloozman
Thanks, again, Hayne. I would be partially happy with this above solution, but even this is not working.

There is something wrong with your system. Have you run any utilities on it? At the least, you should boot from the installer disk and run Disk Utility, disk repair on it.
cwtnospam is offline   Reply With Quote
Old 12-02-2007, 10:07 PM   #7
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 8,531
Preview works with quite a few graphics formats, but certainly not _every_ format. Something unusual may just throw it (and OS X) off track.
Seems like your .xif files are some variation of .tiff (I'm guessing)
Why not use something more versatile for your purpose?
http://www.lemkesoft.com/xd/public/c...lkPTE5Mw_.html
DeltaMac is offline   Reply With Quote
Old 12-02-2007, 11:03 PM   #8
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
Thumbs up Solved it!! Incredible

I was about to write up one more failed attempt, but felt compelled to try every last thing before doing so and I made one last change and much to my surprise, I got the system to make the changes I wanted all along!! I am sorry to report that I am not ABSOLUTELY certain which of these steps made the difference as I will explain below. I hacked my way through this guys. I was too annoyed to run a completely controlled experiment. I now suspect it was a combination of some Firefox add-on extension enhancements and subsequent MIME type edits, along with this very important command below that the Great Hayne of Tintagel emphasized was critical:

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/\
Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill \
-r -domain system -domain local -domain user

Again, this above command comes from this important article:
http://www.macosxhints.com/article.p...51104055843452

The OS X cranked on that for a while, and after that it seems I have FINALLY made Preview.app the default application for .xif files. (You just cannot ignore a suggestion from the great moderator Hayne of Tintagel and consider yourself a self-respecting Mac user or configuration artist, nevermind programmer!! )

I can tell you that all of the firefox add-ons and changes did not work until I ran this command from the terminal. The story becomes a bit more bizarre, however.

At first, I thought the Firefox MIME type add-on and subsequent edits were probably irrelevant and code changes I had maually made yesterday to the Info.plist file in combination with finally running that terminal command above were the two real critical factors. Now that I look through the Info.plist file, however, I noticed that my manual code changes are gone. The changes I had made to that file are not exactly what I had left through editing them manually. Perhaps I failed to save the changes. I am no longer sure. (I am not an experienced XML programmer, so those manual changes were just best guesses, anyway. I did not have much faith in them). But I left some comments around my manual changes and they are no longer there???. Also, I am certain there was no 'xif' file listed in the original Info.plist file until I made those changes, too, but again, my manual commented changes are gone, AND NOW there is a section regarding xif files in that Info.plist file!! How does that happen???

I am no longer sure and I am sorry for that, because I would have liked to have left a clearer step-by-step method for success. What a hack job!!

If I had to guess, I would say the MIME edit changes I had made through firefox in combination with running that command from the Terminal above made the difference. I guess it's possible that running that terminal command above reset the Info.plist file with the Firefox MIME type edits finally in there in proper order. I am terribly sorry I can not be any more clear than that. I am still open to insight from experienced Mac OS X geniuses out there.

I will leave what code changes I observe remaining in the Info.plist file below. The ones dealing with TIFF files were in there already and the italicized code for XIF files (hopefully in purple) seem to be new. That may help whether or not you put them in manually or it is derived from the Firefox add-on MIME edit extension.

Here is the code from Info.plist:

<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>tiff</string>
<string>TIFF</string>
<string>tif</string>
<string>TIF</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>tiff.icns</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/tiff</string>
</array>
<key>CFBundleTypeName</key>
<string>NSTIFFPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TIFF</string>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSIsAppleDefaultForType</key>
<true/>
<key>LSItemContentTypes</key>
<array>
<string>public.tiff</string>
</array>
<key>NSDocumentClass</key>
<string>PVDocument</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xif</string>
</array>
<key>CFBundleTypeName</key>
<string>XIF File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>PBXRTFFileDocument</string>
</dict>



The important change was not these two lines suggested in the article above: <key>CFBundleIdentifier</key>
<string>com.foo.bar</string>

because
<key>CFBundleIdentifier</key>
<string>com.apple.Preview</string>

was in the Info.plist file all along. Apple makes Preview.app after all.

Here is the Firefox add-on link:

https://addons.mozilla.org/en-US/firefox/addon/4498

After properly installing it, you should find the ability to actually use the extension/add-on and make a 'MIME Edit' at the bottom of Tools menu list off of the top of the Firefox browser toolbar. You'll find it there. (There are no instructions with this add-on I unravelled that from yet another google search.

Then follow the advice below in dark red and make the necessary addition of your file type in question to the download action, which in my case was XIF

{type "about:config" in firefox's address bar (without the quotes) and hit enter.

in the filter bar, type "extensions" (again without quotes) and hit enter.

in the results, double click on "browser.download.hide_plugins_without_extensions" so that its value is "false".

now you can edit the list of applications. }


Here's another thread of mine on Mozilla Firefox forum that might help a bit:
http://forums.mozillazine.org/viewto...258&highlight=


Honestly, I don't know if this Firefox add-on extension and subsequent edits make any difference because they did not, by themselves, work at all. But only after doing all of that and then opening up the Info.plist in a text editor and running that Terminal command above did I finally achieve success.

I really hope this helps someone else. This was a maddening little bug to me, and this write-up took me another hour to explain. However, if lots of other people did not write in to help me, I never would have succeeded.
bloozman is offline   Reply With Quote
Old 12-02-2007, 11:22 PM   #9
Las_Vegas
League Commissioner
 
Join Date: Sep 2004
Location: Las Vegas
Posts: 5,875
In post programs, a plist file is loaded to fill a set of specifically formatted datasets. Once the program is finished with the data, if any corrections/changes were made, the plist is written back according to the file's dataset's format. It's very unlikely that comments or erroneous data will be retained.
__________________
Las_Vegas

-- Ts'i mahnu uterna ot twan ot geifur hingts uto.
-- Sometimes I wonder… Why is that Frisbee getting Larger? …and then it hits me.
-- Disposable thumbs make me specialer than most animals…
Las_Vegas is offline   Reply With Quote
Old 12-04-2007, 02:08 AM   #10
bloozman
Prospect
 
Join Date: Dec 2005
Posts: 46
OK, so based on what Hall of Famer Las Vegas is saying, I would guess that my manual XML changes were probably close enough and after running that Terminal Command, the plist saved the data it needed, the data that made sense and discarded the rest -- which is pretty amazing, actually.

I was pretty sure I saved those manual changes. They just did not work until I ran that one last command from terminal. Correct me if I am wrong, but that I now suspect is the likely solution. What is highlighted above in italicized purple is probably the resulting code changes necessary for this particular issue. Similar changes should work when choosing similar applications as the preferred app of choice to work with for each file type, but it might be similar guesswork on the code changes. There still should be a better way.

Probably the MIME Type edit, Firefox add-on was superfluous. It's probably useful to add, though, anyway.

Thank you everyone and special thanks to Hayne. Deltamac, I will look into that lemkesoft stuff, as well. I could use something a bit more versatile. The .xif files are similar to .tiff files as you guessed as far as I can tell. Preview is good enough for my general purposes now. I just was really bothered that I could not choose which app I wanted. I had to solve this one.

Thanks for explaining my remaining confusion, Vegas. CWTNoSpam, I will probably run the utilities when I get a chance, too. Most times when I run utilities, they show nothing, which is, of course, a good sign in a way, but maybe the Mac utilities will be more useful in this case.

You all really helped. I am very appreciative. If this discussion helps someone else with a similar problem, I would be delighted, since so many have helped me. Thanks, again!!!
bloozman is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.