Finder Bug in (Snow) Leopard ?

Hello all,

working on a quite complex project (which included checking of the Adobe Reader version installed on the user systems) I ran in this very strange behaviour of the Finder under OS 10.5 and 10.6 :
The following code example simply tells the Finder to return the version of a chosen application:

set f to choose file
tell application "Finder"
set x to version of f
log x
set y to version of f
log y
end tell

If you run this the FIRST TIME after logging into the system under Leopard and Snowleopard the result is:

As you can see the first version check of the Finder (variable “x”) returns an EMPTY STRING !
If you run the script again it will start and continue to work correctly:

Both variables, x and y, return the correct version string.
The next time you run the script after a new logout/login the first version check will result in an empty string again …

Strange, isn’t it? And as this happens only with (Snow) Leopard - Jaguar/Panther/Tiger work fine - I would call this a real bug.

Good scripting
Farid

PS: In the end I solved the problem without the Finder, using “info for” from the Standard Additions.

It’s very strange to retrieve the version of any application with the Finder.
If you can’t use an respective application tell block, info for is the proper way

Well, version is one of the regular file properties in the Finder dictionary.
I understood after some try and error that is was not a good idea to trust it and that info for works much better.
Nevertheless, the results of the example i posted above still look very strange to me :slight_smile:

Ciao
Farid

Yes, it is, but the purpose is to get the version of the Finder, not any application
Every application has a version property which returns the appropriate value of info.plist.