Odd occurrence opening from Dock

Not all but a couple of my converted documents (Pan6 to PanX) open fine from the desktop HOWEVER opening from the dock causes the file to open showing package contents.

You are not alone; I have the same problem with an old converted Pan6 DB. In my case clicking on the file results in what you show, but dragging the file onto the PanX icon opens normally. In my case doing a SaveAs on the file temporarily fixes the problem and it can be clicked open, but it later repeats the same behavior Only one of my files does this,an ancient one from circa’90.

This can be a problem of your system. You can try to use some utility like OnyX that is able to rebuild the launchservices database, maybe dyld’s cache and XPC cache, too. Then the Pan X database should not appear as a folder anymore but as a Pan X document (bundle).

But if I double click on the file in the Finder it opens in PanX, only if I access from the Dock does this behavior occur.

I do not have an instant answer to this question. Like @kjm, I believe that this is some sort of system problem.

I can provide some technical background on what it going on. macOS has a standard feature called “packages” that can be used to make a folder full of files appear as a single file when viewed in the Finder or the Dock. In other words, the Finder and Dock trick you into thinking that an icon is a file, when it is really a folder. This is a very commonly used feature. ALL applications (.app files) themselves are packages, you can right click on any application and choose Show Package Contents to see all the folders and files that are inside the package. Many applications also use packages for their documents, including some versions of Numbers and Keynote.

Panorama X also uses the package feature. All Panorama X documents are really folders, and contain multiple files inside. There’s a file that contains the data, a file that contains the forms, another file that contains procedures, etc. In Xcode, a package is set up with a single API call. From there on out, everything is set up by macOS. Panorama’s code has no control over how the package folder is set up, macOS takes care of all of that for it.

When setting up a package, macOS sets a special flag on the folder containing the package. This flag tells the Finder and the Dock to pretend that this folder is really a file. Other than this flag, the package is just a folder. If you go into Terminal.app and look at the package, it just looks like an ordinary folder like any other. This flag is set up by macOS itself, not Panorama’s code.

In both of the instances posted here, it sounds like the flag has been set but either the Finder or the Dock is not recognizing the flag. In Leo’s case, for some reason the Dock is ignoring the flag. But we know it is set because the Finder is recognizing that this is a package, not a folder. So it seems the problem is with the Dock.

Donald’s situation is the reverse – the Dock understands that it is a package, but the Finder doesn’t. So it seems like there is a problem with the Finder.

As Kurt mentioned, various parts of macOS keep caches of information about files. This speeds up access to files, including information about which folders are packages and which are just folders. Most likely one or more caches on your system have gotten out of sync. This kind of problem is rare, and I am not an expert in this area, but cache problems can occur and that is why programs like OnyX were created. (I’m not recommending OnyX in particular, I have never used it but I have heard of it and it has been around a long time. I’m sure there are other programs, and also I imagine the caches can be reconstructed from Terminal.app using some arcane incantation).

This kind of cache problem can and does happen to any document, not just Panorama databases. I believe there is nothing Panorama can do about this – the problem is not in Panorama, but in the extra cache information kept by the Finder, Dock, or macOS itself.

FYI I did save the file using SAVE AS and it worked fine for a short time from the Dock but now has reverted to opening as a package. Still works fine from the Finder. I’ll run CleanMyMac and report back if it rectifies the problem.

I certainly don’t claim to be a Panorama or Apple guru, though I’ve cohabited with both for decades, but it just seems suspicious that several DBs (LeoC2 's and mine) all of which I presume opened fine before conversion, right after conversion develop the same glitch. It is very tempting to see a cause and effect whether its real or not, and say something in the converted file is reacting to something in the system to cause this error. Fortunately, it falls into the curiosity category, as the file is accessible and functioning normally.

One more thing about this… I shoujld elaboate the exact sequence so this may help. The file itself is not in the doc, the doc is accessing a folder and the file is in that folder. When I click on the file I get the package contents HOWEVER if I then click on the OPEN IN FINDER icon while the package contents are showing the file opens fine.

I could not duplicate this issue. I was able to put a folder containing Panorama X databases into the dock, the databases showed up in the dock menu just fine. Clicking on a database in the dock menu opens the database. At no point are package contents displayed.

I did find that if I put an alias of a folder into the dock, the dock menu doesn’t work – no matter what sort of files are in the folder.

I should point out that in all of these cases, including Leo’s, there is no Panorama code involved. If there is a bug here, it is in the Apple’s Dock code, not in Panorama.

For whatever it’s worth, my misbehaving file is also in a folder in the dock.