Hello
I'm accustomed to non fatal errors issued when an OSAX function is called from a tell application wrapper but for the first time, I got a fatal error.
"Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt" set posixPath to POSIX path of result (*/Users/yvankoenig/Desktop/Create a new file from a list.scpt*)
log POSIX file posixPath # file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt" tell application "Finder" log my POSIX file posixPath # file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt" POSIX file posixPath (* error "Erreur dans Finder : Il est impossible d’obtenir POSIX file \"/Users/yvankoenig/Desktop/Create a new file from a list.scpt\"." number -1728 from file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt" *) end tell
I wrote this awful script for tests. On entry is a string describing an Hfs+ pathname. The 2nd instruction build the UNIX path to the file.
As it's out of the tell wrapper, the 3rd instruction behave flawlessly. When it's preceeded by « my », the same instruction behaves well in the wrapper. But when I try to use the naked one, I don't get the well known non-fatal error but a fatal one.
I'm a bit surprised because the Script editor display « POSIX file » exactly the same way in the three instructions. To be sure of that, I changed temporarily the format applied to class of Scripting Additions and the custom format is really applied to the three occurences.
I guess that I am missing something but I don’t guess what.
Yvan KOENIG (VALLAURIS, France) dimanche 16 décembre 2012 18:17:01
|