Open with Blitzmax 'Change all' broken?

Archives Forums/MacOS X Discussion/Open with Blitzmax 'Change all' broken?

remz(Posted 2006) [#1]
While trying to make my application open .JPG files, I may have discovered something wrong in Blitzmax configuration.

Try the following:
- Locate any .BMX source file
- Do Get Info
- In the Open with: section, select other...[b], browse and select another application, such as [b]TextEdit.app.
- Click on Change All...
- Now click again and select MaxIDE.app, then click on Change All... to revert back to normal.

Boom: I get the error message:

The operation could not be completed.
An unexpected error occurred (error code -10813).



I have looked up for this error message on Apple website and found this:

kLSDataUnavailableErr -10813
Data of the desired type is not available (for example, there is no kind string).



The 'kind string' is most probably the type name of the registered extension .bmx, which in this case is MaxIDE.app Document, i.e.: The default name. But I have spent hours fiddling around and it doesn't seem to be obvious to fix.

What is going wrong?


skidracer(Posted 2006) [#2]
This may have something to do with BlitzMax apps (maxide being one) not having a CFBundleExecutable key set in their plist as discussed in the other thread.


morszeck(Posted 2006) [#3]
I have the same problem! Only in an german-mac-forum:

http://www.macuser.de/forum/showthread.php?t=187071&highlight=10813

but still no solution


Brucey(Posted 2006) [#4]
You probably want to add something like this to your app plist file :
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>jpg</string>
            <string>jpeg</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>A jpeg image</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <false/>
    </dict>
</array>

See here for more information.

:o)


morszeck(Posted 2006) [#5]
this is my momentary conditions:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>bmx</string>
			</array>
			<key>CFBundleTypeIconFile</key>
			<string>MaxIDE.icns</string>
			<key>CFBundleTypeName</key>
			<string>BMX Document</string>
			<key>CFBundleTypeOSTypes</key>
			<array>
				<string>BMX</string>
			</array>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
		</dict>
	</array>
	<key>CFBundleExecutable</key>
	<string>MaxIDE</string>
	<key>CFBundleIconFile</key>
	<string>MaxIDE.icns</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
</dict>
</plist>


The problem is already with the installation of BlitzMax, or is this by MacOSX steered?


remz(Posted 2006) [#6]
Skidracer: about CFBundleExecutable, I added this key to my app and I still get the same error, so I don't think it's the cause.

Brucey: I already added all these keys for my own app, but my bug report was about BlitzMax IDE itself (as I was trying to mimic its plist for my app).

I'll try a different approach: I'll start by coping a correctly working application (such as preview.app), and then tear it down until I get the same error. I'll try to nail down the key or the file responsible for this Apple cryptic error message.


skidracer(Posted 2006) [#7]
I added this key to my app and I still get the same error

I was suggesting that MaxIDE itself needs the key added.


remz(Posted 2006) [#8]
Good news: I found the culprit!
MaxIDE needs the key CFBundleIdentifier in its plist. I suggest setting it to something similar than Apple, like: com.brl.MaxIDE
As a suggestion, Blitz should also automatically add this key to all compiled app by setting it to something more or less unique, like com.brl.[app name]

(And as stated by skidracer, CFBundleExecutable should also be set to MaxIDE itself and to all blitz' compiled apps to allow renaming.)

Please remember that whenever you modify plist, you need to 'touch' the application to tell Mac OS X about the change. You can use 'touch' from a terminal window. (I haven't found any way to perform that action from Finder)