Le 2015/12/09 à 17:50, S. J. Cunningham < email@hidden> a écrit :
On Dec 9, 2015, at 8:46 AM, Yvan KOENIG wrote: set theName to "trucmuche" --set sourcefolder to (path to desktop as text) & "formoosmahna:" as alias set sourcefolder to choose folder tell application "System Events" if not (exists folder theName of sourcefolder) then make new folder at end of sourcefolder with properties {name:theName} end if -- set dest to quoted form of POSIX path of ((sourcefolder as text) & theName) tell me to set dest to quoted form of POSIX path of ((sourcefolder as text) & theName) end tell
Well, I get the same error in Snow Leopard so if it's an error, it must have been around for a while. Steve ------------------
What is puzzling is not the fact that set dest to quoted form of POSIX path of ((sourcefolder as text) & theName) fails in a System Events block. I know for months that we aren’t supposed to use OSAX features in a tell application block. But I know also that Apple explained that tell me to set dest to quoted form of POSIX path of ((sourcefolder as text) & theName) is THE way to get rid of this rule.
So, the official scheme doesn’t work. Here, the problem isn’t quoted form as I read in at least an other message, it’s POSIX path as we may see here :
set theName to "trucmuche" --set sourcefolder to (path to desktop as text) & "formoosmahna:" as alias set sourcefolder to choose folder tell application "System Events" if not (exists folder theName of sourcefolder) then make new folder at end of sourcefolder with properties {name:theName} end if -- set dest to quoted form of POSIX path of ((sourcefolder as text) & theName) tell me to set dest to quoted form of my posixIt((sourcefolder as text) & theName) end tell on posixIt(aPath) return POSIX path of aPath end posixIt
I will have to look more in depth in my scripts. After all, maybe I took care of the problem and carefully used small blocks speaking to System Events so that POSIX PATH is not called in such blocks.
Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) mercredi 9 décembre 2015 18:10:34
|