An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#23088 - 08/15/12 09:55 AM Finder Preference - OS X 10.8
MG2009 Offline


Registered: 08/05/09
Since installing MOUNTAIN LION, there has been a change in the FINDER TOOLBAR which I liked having available with LION.

Under FINDER / FILE the option to open a file using "open with" is GRAYED OUT. But default, all document files are now opening with the Text Edit app - regardless of the format in which these were saved. In LION, one could change individual documents to open with different applications, but that feature is no longer active in MOUNTAIN LION's FINDER.

How do I 'unlock' FINDER so that I can re-activate the "open with" option?

Thanks.


Top
#23091 - 08/15/12 12:24 PM Re: Finder Preference - OS X 10.8 [Re: MG2009]
ganbustein Offline


Registered: 08/04/09
Mountain Lion is no different in this regard from any prior version of OS X: File→Open With... is grayed out until you select a file.

In particular, it's grayed out if you have no selection, or if you select a folder.

Top
#23094 - 08/15/12 01:20 PM Re: Finder Preference - OS X 10.8 [Re: ganbustein]
MG2009 Offline


Registered: 08/05/09
Thanks for the info. Quite possibly I was trying to open a 'folder' and not a file.

So . . . I made sure I was on a FILE this time and, yes, it works as I would expect it to do (i.e. "open with" becomes UN-GRAYED and functional).

HOWEVER . . .

A new issue has arisen. If I then take that file, save it in the preferred format, then make a new alias of the 'new' file, that new alias will open the document in the old format and not the new one

e.g. I have a file saved as .ODT and 'always' open it with NeoOffice. I made an ALIAS from this file. When I click on the alias, the file will open in the old format using the TEXT EDIT application and not NeoOffice.

Any ideas as to why the Alias does not recognize the new file format and reverts (by default) to opening the ODT file in TEXT EDIT ?

confused


UPDATE: On a lark, I went about and started opening various ODT files and making aliases . . . and then opening the files from those aliases. The problem "seems" to have corrected itself. Not sure why. I will post again if the issue rears its ugly head later. smile


Edited by MG2009 (08/15/12 01:37 PM)

Top
#23095 - 08/15/12 01:46 PM Re: Finder Preference - OS X 10.8 [Re: MG2009]
artie505 Online


Registered: 08/04/09
If the issue recurs, rather than using "Open With," you can do a "Get Info" on one of your files, select the app you want to open it with, and then "Change All."
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#23096 - 08/15/12 02:03 PM Re: Finder Preference - OS X 10.8 [Re: artie505]
MG2009 Offline


Registered: 08/05/09
THAT'S the ticket!

Using an ODT file, I got INFO and selected that "all similar (ODT) files should be opened with the same application" i.e. NeoOffice 3.4.0

It worked. I made new ALIASES from (a few of) the files in question, and those aliases now open those ODT documents in Neo Office (as hoped) and no longer revert to the TEXT EDIT application for viewing.

Thanks a bunch.

Top
#23097 - 08/15/12 02:27 PM Re: Finder Preference - OS X 10.8 [Re: MG2009]
artie505 Online


Registered: 08/04/09
cool

Happy to have been able to help. smile
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#23101 - 08/15/12 06:37 PM Re: Finder Preference - OS X 10.8 [Re: MG2009]
ganbustein Offline


Registered: 08/04/09
There's a difference between selecting a file and choosing File→Open With..., and selecting the same file, choosing "Get Info", and making a selection from the "Open with:" menu. Yeah, yeah, they're both "Open with..." menus, but they're different "Open with..." menus.

The former means "Open this file, but this one time only open it with the application I select". The file is not modified, and will open next time just like it always has.

The latter means "Change this file so that it always opens with this application, irrespective of how it behaved before, or how similar documents behave." (What happens is that an alias to the application is stored in the resource fork of the file, creating that resource fork if needed. The application is also asked what icon it would normally assign to this type of file, and the file is given a matching custom icon, also stored in the resource fork. For completeness, a copy of the appropriate "kind" string is also copied into the resource fork, where you'll see it after "Kind:" the next time you Get Info. Naturally, you need write access to the file to pull any this off.)

Unless, after making a selection from "Open with:" in the Get Info dialog, you click on "Change All...". In that case, the document is not altered. Instead, your personal copy of the Launch Services database is updated to say that all similar documents should open with that application, when you're the one doing the opening. (With any luck, this document will be similar enough to itself to be affected.)

In case of a conflict, "Get Info→Open with" trumps "Get Info→Open with→Change All". That is, if you've specified what application opens this document, it doesn't matter what application you've selected to open similar documents.

If you try to change the "Open with:" attribute of a file you don't have write access to, you'll be asked if you really wanted to "Change All..", since that's the only kind of change you can make.

Aliases have nothing to do with it. The alias leads to a document, and it's the document that decides (with help from Launch Services) how it's going to open.

And I emphasize: Finder's File→Open With... menu command is a "just this one time" deal. Neither the file nor Launch Services nor any aliases created before or after are affected in any way. It makes up for its lack of permanence by being able to override any other choice of application.

Top
#23102 - 08/15/12 08:36 PM Re: Finder Preference - OS X 10.8 [Re: ganbustein]
MG2009 Offline


Registered: 08/05/09
Thanks for the detailed response, although I am not sure I followed it completely.

blush

From my earlier inquiry:


. . . If I then take that file, save it in the preferred format, then make a new alias of the 'new' file, that new alias will open the document in the old format and not the new one . . .

. . . I made new ALIASES from (a few of) the files in question, and those aliases now open those ODT documents in Neo Office (as hoped) and no longer revert to the TEXT EDIT application for viewing . . .

As far as . . . "aliases have nothing to do with it" . . . is concerned, there must be some connection because the ODT files that were 'supposed' to open in NeoOffice and their respective aliases (but didn't) now both open the same application i.e. now clicking on the aliases does not open the file with TEXT EDIT - as was the case earlier - but NeoOffice, as desired. Previous to taking the Get Info - Change All steps, the aliases for the ODT file would open TEXT EDIT to view the file whereas clicking directly on the file would produce the desired behaviour (having ODT files open in Neo Office). Therefore, it would seem that doing Get Info - Change All affected both the aliases and the file because clicking on either one now will open the ODT document in NeoOffice. Updating the Launch Services Database would appear to have affected the files and their respective aliases in one step : Get Info - Change All.

Regardless of how the cat was skinned, doing Get Info - Change All did resolve the issue for having the document and its alias work in sync with NeoOffice. I am relieved that I don't have to create a new alias for each of the ODT documents in my computer - as in the green highlight above - but was able to accomplish this task for each document by going into one ODT file only and applying the same attributes to all my ODT files and their aliases in ONE step. grin Whew !!!


Edited by MG2009 (08/16/12 04:56 PM)
Edit Reason: highlighted quotes

Top
#23127 - 08/16/12 04:23 PM Re: Finder Preference - OS X 10.8 [Re: ganbustein]
artie505 Online


Registered: 08/04/09
Nice explanation; thanks.
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#23133 - 08/17/12 09:25 AM Re: Finder Preference - OS X 10.8 [Re: MG2009]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
Originally Posted By: MG2009
As far as . . . "aliases have nothing to do with it" . . . is concerned, there must be some connection because the ODT files that were 'supposed' to open in NeoOffice and their respective aliases (but didn't) now both open the same application i.e. now clicking on the aliases does not open the file with TEXT EDIT - as was the case earlier - but NeoOffice, as desired. Previous to taking the Get Info - Change All steps, the aliases for the ODT file would open TEXT EDIT to view the file whereas clicking directly on the file would produce the desired behaviour (having ODT files open in Neo Office). Therefore, it would seem that doing Get Info - Change All affected both the aliases and the file because clicking on either one now will open the ODT document in NeoOffice. Updating the Launch Services Database would appear to have affected the files and their respective aliases in one step : Get Info - Change All.


When you click on a file and choose Open With, but you don't choose Change All, your compute makes a special hidden list buried deep in the secret recesses of Mac OS X. This hidden list is consulted when you double-click a file. It will look at the list and say "Is the file that was just double-clicked on in this list?" If the answer is 'yes' it will open it with the program you specify. If the answer is 'no' it will open it with the default program for that app.[1]

So let's say you have a file called MyInformation.odt. Normally, ODT files open with Text Edit. You change MyInformation.odt to open with NeoOffice. The Mac makes a list, and on that list it says "MyInformation.odt opens with NeoOffice."

All good, so far. Now you make an alias to the file.

But now it gets sneaky. Now you have a new file, that's called "MyInformation.odt alias". You double-click on that. The Mac finds the reference to "MyInformation.odt" and goes to look up what program to use.

It consults its secret list. The list has "MyInformation.odt" on it...but it does not have "MyInformation.odt alias" on it! So it doesn't "count" as being in the list, and the Mac uses Text Edit to open the file.

It shouldn't; you've found a bug. The Alias Manager should resolve the original file's filename and then check to see if the original file (not the alias) is listed in the exceptions. But it doesn't.

[1] It's a little more complicated; information besides just the filename is kept. But that's the quick and dirty basic idea.
_________________________
Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Top
#23134 - 08/17/12 09:44 AM Re: Finder Preference - OS X 10.8 [Re: tacit]
MG2009 Offline


Registered: 08/05/09
". . . you've found a bug . . . "


A bug? Fortunately, it would appear that Get Info - Change All fixes the "bug" as all the aliases associated with the NeoOffice documents now open those ODT files in NeoOffice WITHOUT having to individually redo all the aliases. (i.e. Now only the aliases for TEXT EDIT files open their corresponding TEXT EDIT documents. All seems to be behaving as expected.)

P.S. Using MOUNTAIN LION with MBPro (2011). The only step taken before and after the issue arose was the Get Info - Change All. Unless . . . Alias Manager has some how kicked in, it would seem the Get Info - Change All gets credit for the fix. grin

Top
#23136 - 08/17/12 01:00 PM Re: Finder Preference - OS X 10.8 [Re: tacit]
Ira L Offline


Registered: 08/13/09
Loc: California
What if double-clicking the alias results in the correct application opening, but the application immediately puts up an Open dialog box waiting for you to select the original (?) to open?

This is happening to me with Filemaker Pro 12 and aliases of some databases.

Remember FM Pro 12 is correctly starting up, but it gives an Open dialog. What's that? A different bug? Never happened with FM Pro v. 6 through 11.
_________________________
On a Mac since 1984.
Currently: 27" iMacs, Macbook Air, macOS 10.14.x,; iPhones, iPods and iPads galore!

Top
#23138 - 08/17/12 01:12 PM Re: Finder Preference - OS X 10.8 [Re: Ira L]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
When you double-click on a file and launch a program, OS X sends an "event" to the program saying "Here is a file that has been double-clicked on". The program then handles the event by taking the action that the programmer feels is appropriate.

When the program is handed an alias, it receives an alias record that has a bunch of information, including a pointer to the original file. The programmer can choose whether to "resolve" the alias (by examining the alias, looking at the file it's pointing to, and then opening that file), or whether to open the alias file itself. (It is rare that you'd want to open the alias file itself, but there are times you might want to--for example, if you've written a program that checks and fixes broken aliases.)

It sounds like, for whatever reason, Filemaker doesn't always reliably follow the alias record to the original file, so it's looking at the alias file, realizing it can't open it, and throwing up a file requestor asking you to find a file it can open. That would definitely be a bug in Filemaker.
_________________________
Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Top
#23143 - 08/17/12 09:41 PM Re: Finder Preference - OS X 10.8 [Re: tacit]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: tacit
When you click on a file and choose Open With, but you don't choose Change All, your compute makes a special hidden list buried deep in the secret recesses of Mac OS X. This hidden list is consulted when you double-click a file. It will look at the list and say "Is the file that was just double-clicked on in this list?" If the answer is 'yes' it will open it with the program you specify. If the answer is 'no' it will open it with the default program for that app.[1]

So let's say you have a file called MyInformation.odt. Normally, ODT files open with Text Edit. You change MyInformation.odt to open with NeoOffice. The Mac makes a list, and on that list it says "MyInformation.odt opens with NeoOffice."

All good, so far. Now you make an alias to the file.

But now it gets sneaky. Now you have a new file, that's called "MyInformation.odt alias". You double-click on that. The Mac finds the reference to "MyInformation.odt" and goes to look up what program to use.

It consults its secret list. The list has "MyInformation.odt" on it...but it does not have "MyInformation.odt alias" on it! So it doesn't "count" as being in the list, and the Mac uses Text Edit to open the file.

What????

That's completely wrong. There is no secret list. When you Get Info→Open with: and do not click on "Change All...", Finder adds a 'usro'(0) resource to the document's resource fork, creating the resource fork if necessary. The content of a 'usro' resource is what's called an "Alias Record", which is what an "alias" really is. In this case, the Alias Record points to the application you just selected.

(Alias Records are used all over the place in MacOS and in OS X. The Dock remembers which things you've put on the Dock by saving an Alias Record for each one. The ones you've marked to remain in the dock have their Alias Records written into Dock's preferences. Your "Recent Items" lists are lists of Alias Records. Creating an Alias File in Finder is merely one of the more visible uses of Alias Records; in particular, an Alias File is a file that has an 'alis'(0) resource containing an Alias Record. It's the Alias Record that embodies the magic that we blithely refer to as "an alias".)

If you double-click on an alias file in Finder, Finder begins by resolving the Alias Record it contains, to find the actual document. Once the document has been found the alias file itself is no longer relevant. It has been used up, so to speak, and plays no further part in the process.

Now that the document has been found, Finder looks in it for a 'usro'(0) resource, and if one is present resolves it to find the application. (If there there were no 'usro'(0) resource, Finder would ask Launch Services to find the appropriate application. Launch Services does, indeed, consult "a special hidden list buried deep in the secret recesses of Mac OS X", but in our scenario we never get around to asking Launch Services which application to use. Had you chosen "Change All..", it would indeed be Launch Services' hidden secret file that got updated, but we're assuming you didn't, so that a 'usro'(0) resource got created instead.)

Finder launches the application, and passes it a list of Alias Records pointing to the documents it's supposed to open. These Alias Records are constructed on the fly, and point directly to the documents. Even if you double-click on an alias file, the Alias Record that gets passed to the application does not point to the alias file, nor is it extracted from the 'alis'(0) resource it contains.

I repeat: it makes absolutely no difference whether you double-click on a document or an an alias file that points to the document. In fact, a not infrequent plaint among beginning programmers, especially beginning AppleScripters, is that there is no way for the application to learn whether an Alias File was involved, let alone which one.

Either way, Finder
  1. Finds the document
    • If you double-clicked on it, that's the one, or
    • if you double-clicked on an alias file that points to it, the alias is resolved to find the document
  2. Finds the application
    • If the document contains a 'usro'(0) resource, the contained Alias Record is resolved to find it
    • Otherwise, Launch Services is asked to find a suitable application
  3. Finder makes a new Alias Record to the document itself
  4. The application is launched if it wasn't already running.
  5. The application is passed an 'open' AppleEvent that contains the Alias Record just created.
  6. The application resolves the Alias Record and opens the document.


Edited by ganbustein (08/17/12 09:45 PM)

Top
#23147 - 08/18/12 07:31 AM Re: Finder Preference - OS X 10.8 [Re: tacit]
Ira L Offline


Registered: 08/13/09
Loc: California
Originally Posted By: tacit
When you double-click on a file and launch a program, OS X sends an "event" to the program saying "Here is a file that has been double-clicked on". The program then handles the event by taking the action that the programmer feels is appropriate.

When the program is handed an alias, it receives an alias record that has a bunch of information, including a pointer to the original file. The programmer can choose whether to "resolve" the alias (by examining the alias, looking at the file it's pointing to, and then opening that file), or whether to open the alias file itself. (It is rare that you'd want to open the alias file itself, but there are times you might want to--for example, if you've written a program that checks and fixes broken aliases.)

It sounds like, for whatever reason, Filemaker doesn't always reliably follow the alias record to the original file, so it's looking at the alias file, realizing it can't open it, and throwing up a file requestor asking you to find a file it can open. That would definitely be a bug in Filemaker.


A very plausible explanation. However, it may also be a bug in Default Folder (which I happen to use). While not explicitly stated as a problem, Default Folder has indicated issues with 10.8, which they are working on.
_________________________
On a Mac since 1984.
Currently: 27" iMacs, Macbook Air, macOS 10.14.x,; iPhones, iPods and iPads galore!

Top
#23152 - 08/18/12 11:35 AM Re: Finder Preference - OS X 10.8 [Re: ganbustein]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
Originally Posted By: ganbustein
Originally Posted By: tacit
When you click on a file and choose Open With, but you don't choose Change All, your compute makes a special hidden list buried deep in the secret recesses of Mac OS X. This hidden list is consulted when you double-click a file. It will look at the list and say "Is the file that was just double-clicked on in this list?" If the answer is 'yes' it will open it with the program you specify. If the answer is 'no' it will open it with the default program for that app.[1]

So let's say you have a file called MyInformation.odt. Normally, ODT files open with Text Edit. You change MyInformation.odt to open with NeoOffice. The Mac makes a list, and on that list it says "MyInformation.odt opens with NeoOffice."

All good, so far. Now you make an alias to the file.

But now it gets sneaky. Now you have a new file, that's called "MyInformation.odt alias". You double-click on that. The Mac finds the reference to "MyInformation.odt" and goes to look up what program to use.

It consults its secret list. The list has "MyInformation.odt" on it...but it does not have "MyInformation.odt alias" on it! So it doesn't "count" as being in the list, and the Mac uses Text Edit to open the file.

What????

That's completely wrong. There is no secret list. When you Get Info→Open with: and do not click on "Change All...", Finder adds a 'usro'(0) resource to the document's resource fork, creating the resource fork if necessary. The content of a 'usro' resource is what's called an "Alias Record", which is what an "alias" really is. In this case, the Alias Record points to the application you just selected.


I've just been looking at the Apple tech information on their developer site, and it appears that my information is outdated. If I'm reading it correctly, what you say is correct for OS X 10.2.0 and later; prior to that, exceptions were stored in the Launch Services database. (I haven't looked at the Launch Services documentation in a long time.

It also appears, as an interesting quirk, that the usro(0) resource does not contain an alias record. Instead, it contains four bytes indicating the length of the resource, followed by a hard-coded path to the application that's been chosen. This means, among other things, that if the path to the application changes (if the application is moved or renamed, for example), the new setting for "Open With" will fail. It also means that if you copy a file containing a usro resource from a PPC Mac to an Intel Mac or vice versa, the mapping will fail, because there is no provision for storing the endian value of the four-byte path length indicator. PPC Macs expect it to be big endian; Intel Macs expect it to be little endian. (I have an PPC and an Intel Mac but I haven't tested this.)

Originally Posted By: ganbustein
I repeat: it makes absolutely no difference whether you double-click on a document or an an alias file that points to the document. In fact, a not infrequent plaint among beginning programmers, especially beginning AppleScripters, is that there is no way for the application to learn whether an Alias File was involved, let alone which one.


That might be true in Applescript. I don't know; I don't use AppleScript. It is not true in Xcode and in other programming languages. In these environments, Open and Drag events will contain a reference to the alias if an alias file is used to open a file (or an alias is dragged to the application). It is the programmer's responsibility to resolve the alias using FSResolveAliasFile or FSResolveAliasFileWithMountFlags in Carbon. It's a bit trickier in Cocoa; you start with an NSString that contains the alias record, and you have to massage it to an fsRef, resolve the fsRef using FSResolveAliasFile, and turn the result back into an NSString using CFURLCreateFromFSRef or HSURLCreateFromFSRef. The upshot is that, yes, a program can tell if it was opened from an alias or an actual file.
_________________________
Photo gallery, all about me, and more: www.xeromag.com/franklin.html

Top
#23154 - 08/18/12 07:47 PM Re: Finder Preference - OS X 10.8 [Re: tacit]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: tacit
If I'm reading it correctly, what you say is correct for OS X 10.2.0 and later; prior to that, exceptions were stored in the Launch Services database.

The 'usro' mechanism was actually introduced in MacOS System 7 (the same release of MacOS that introduced aliases).

Originally Posted By: tacit
It also appears, as an interesting quirk, that the usro(0) resource does not contain an alias record. Instead, it contains four bytes indicating the length of the resource, followed by a hard-coded path to the application that's been chosen. This means, among other things, that if the path to the application changes (if the application is moved or renamed, for example), the new setting for "Open With" will fail. It also means that if you copy a file containing a usro resource from a PPC Mac to an Intel Mac or vice versa, the mapping will fail, because there is no provision for storing the endian value of the four-byte path length indicator. PPC Macs expect it to be big endian; Intel Macs expect it to be little endian. (I have an PPC and an Intel Mac but I haven't tested this.)

For quite some time now, an Alias Record has been considered by Apple to be an opaque data structure. That is, they do not reveal any clues about the internal structure of one, expecting all users to treat an Alias Record as a blob of bytes of indeterminate structure. They've made use of this to change the internal formats of Alias Records many times since making them opaque. I say "formats", plural, because indeed they do not all have the same internal structure. (One change that has become known is that many Alias Records now contain what is essentially a symbolic link, along with whatever other information they may carry that allows the symbolic link to repair itself if broken. But just as symbolic links come in two flavors (absolute or relative, according as the first character is or is not a slash), Alias Records can come in many flavors.

The internal format of an Alias Record is not documented anywhere. (That's what it means to be "opaque".) But when I look at a 'usro' resource, what I see is a two-byte type field, equal to 0 and probably meaning "the simplest possible Alias Record format: it's just a symbolic link". Then a two-byte length field, giving the number of bytes in the UTF8 absolute path to the application, followed by a null byte that is not counted in the length. (The null byte reveals itself if you change the "open with" application to one with a shorter name; the UTF8-ness reveals itself if you select an application with a non-ASCII name.)

In short, who's to say this isn't one of the many valid formats for an Alias Record? It does share (and in spades) the ancient problem with forcing a document to open with a specific application: it wants to forever after open with that specific application, even if you have another later version of the app installed elsewhere. (It also shares the ancient advantage that you can force a document to open with a specific version of an application, even if you have a later version of it installed elsewhere.)

As for the endianness, don't worry about it. All resources are stored big-endian on disk. Any necessary byte-swapping is done on the fly by the Resource Manager, at least for any resource types whose format it knows. (I recall that there's a way to add new formats its list, but I don't recall the details. Most apps that do custom formats register their own byte-swapping routines.)

Originally Posted By: tacit
Originally Posted By: ganbustein
I repeat: it makes absolutely no difference whether you double-click on a document or an an alias file that points to the document. In fact, a not infrequent plaint among beginning programmers, especially beginning AppleScripters, is that there is no way for the application to learn whether an Alias File was involved, let alone which one.
That might be true in Applescript. I don't know; I don't use AppleScript. It is not true in Xcode and in other programming languages. In these environments, Open and Drag events will contain a reference to the alias if an alias file is used to open a file (or an alias is dragged to the application).

I'll look into that. As I said, open ALWAYS gives you an alias of some sort. But I thought that alias could only point to an alias file if you got it from the open dialog, and set the flag indicating you did not want it to automatically resolve aliases.

Of course, for a drag and drop, what's passed on the pasteboard is whatever the source application wants to put there, and an application may need to be prepared for whatever it's given. But when it's Finder doing the passing, whether through drag and drop or double-click, what Finder passes has always already been resolved. Or so I've always understood.

Top

Moderator:  alternaut, dkmarsh, joemikeb