On 29 apr 2006, at 11.02, Tony Spencer wrote:
Hi Sven
Seems this thread had got a little out of hand!
It is quite surprising that Joe is of the opinion that Mac apps
don't have pull downs in the Open menu. Although he no longer works
for RS, it wasn't that long ago since he did, so if he thinks that
way, it's a fairly sure bet RS thinks that way too. And we have
shown that this is not a trick used by MS or Adobe, because Apple
and third party shareware apps also use pull downs.
It is some dangerous, to say that "It is not Mac", because so many
trust Joe, without check it out by them self.
And some of us that know or check it, must be wondering 'what could
the Mac developer expect of RB in the future'
(Here in Sweden, we have 'Salesman Training Camps', if you asked an
'bad' question, you get 10 answers in one second, that show that you
are wrong, only those that have the time to check up the answers
could get 'right' after an long fight, so in mostly time you give up
and give the salesman right. And if you notice, the answers must not
have to do with your question, the answers is just to get you to
'fail' and be 'defends less' )
Anyway, the heart of the matter is your particular problem. Many
people have commented on the correct way to select files using
MacType, and they are largely correct. Most of the apps I and other
mentioned that have pulldowns clearly use MacType as the
fundamental separation issue eg Word versus Excel files, Tiff
versus Jpeg, although some may use an extension filter too.
Your problem is that text, html and xml files are all text files,
i.e. of MacType text. That is to say that are not magically
different, but are just composed of ordinary text characters, such
as angle brackets and characters. It is up to the opening software,
such as a web browser, to parse for what are defined as "tags" and
display the text correctly. The same applies to xml.
As such, as you have found, using MacType="text" will display all
types of text files, but of course that will open any xml files
that have no extension, or are "incorrectly" labelled
as .txt, .xtml or .htm.
It would be my opinion that using multiple filtering options should
generate an exclusive group for the Open Dialog, not an inclusive
group, but this may be an OS problem rather than a Rb bug. If the
latter, then of course it should be fixed. This seems to be part of
your problem.
Yes I am not an 'expert' on this. So I have to ask, but now the
problems look to be 'could I trust the experts' ?
Ok I could accept that is an OS problem, If I get an answer that show
it, not only 'that is wrong' and then PhotoShop doing exactly what i
wanted in 'Import PDF Picture' ..
And here is some that many refuse to accept: (or remove my text in
the answers)
1 - Take a screen shot ( OS X 10.4.6)
2 - The OS generate an PDF picture with NONE MacType
3 - Import PDF in PhotoShop
4 - PhotoShop only showing .PDF (Okey that is an own MacType I think,
but again the OS DO NOT add an MacType
5 - Rename the extension of the pdf file to something .pdf3
6 - Then try to Import it again, you can't (bad or good is an another
question)
7 - Why? Now also Mac OS X and Apple created applications don't
create MacTypes, so the only and 'Cross Platform that REALY works, is
to trust the file extension.
Please NOTE this is not an defence speak, it is only the result i get
when i check some of this problems.
And please do not try to doing this blind for others, they have to do
what they wanted to handle this.
This IS MAC Today, perhaps not for 5 - 10 years ago
If however you are sure you only want to display files with an
extension of .xml, and ignore any other valid xml files
(eg .plist), then your solution works fine but it will not open all
files that have xml tags in them.
As you said, no there are no other files that should be opened,
whatever they have inside. (Only Word XML)
And I asked my beta testers, YES filter it out! Better that it works
fast and easy 99.5% of the times, and fails when some changed the
extension.
To be able to open every file that contains xml then you will have
to allow all text files, and have parsing code in your app that
will then bring up a dialog after Open if the file contains no xml,
since text files may or may not have any hidden file or header info.
As far as I can see there is no other way to do this.
To reiterate: there is no real difference between
the .txt, .htm, .html, .xtml or .xml extensions - they are all text
files. It is just *convention* that .xml files should contain xml,
just as .htm and .html should contain html. As an example, html
files should all have a tag with the version of html used as the
first line, but if it's not there, the web page will still be
readable, it's just convention that the line is there as an aid to
browsers. Ultimately there is no way of knowing what is in a text
file until you open it.
We all know, how bad and really bad the (HTML) files are declared. So
open it and check for the declare, fails much more times than they
rename the extension to .app. J.J tell me just that you should do
that, and then I test to open an .xml file in REALbasic, what
happens? An hang! And I don't blame REALbasic for this, because it is
not easy to do it! It The only I wanted to do was to show that the
way to do so could simply fail. (In this case it was an .xml file and
should be an .xml file, but the file was an Word XML (with declare
inside)
Another example would be .ico files for favicons, those little
16x16 icons that show up in the nav bars of browsers. There is no
such thing as an .ico file (at least in this context), as they can
be tiffs, jpegs or gifs. They do not have to have a special graphic
format. The convention of calling them .ico is so that MS IE knows
what to do with them. But on a Mac, with a MacType, it aids
tremendously in opening these, because due to licensing problems,
not all graphics apps can open gifs for example.
Tony Spencer
And after that, my question is how do i show 'hidden files' in the
OpenDialog Box.
But i feel that is not time for that yet, because I have not trying
to find it out self yet.
I found some stuff here, but I have not checked it out yet, an Plugin
called NavDialog
http://homepage.mac.com/vanhoek/
(So there are Mac people that understand that there is/have been an
need for this)
Regards,
Sven E Olsson
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>