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.