Snow Leopard, Files and AppleScript
Snow Leopard’s broken some of my AppleScripts in some weird way I don’t yet understand. After some debugging the problem seems to lie in files. Specifically files treated as strings. This no longer works:
set libraryFile to file "Macintosh HD:Users:elharo:Cafe Au Lait:support:CafeLib.scpt"
Nor does this:
set libraryFile to alias "Macintosh HD:Users:elharo:Cafe Au Lait:support:CafeLib.scpt"
They both die with
error “File alias Macintosh HD:Users:elharo:Cafe Au Lait:support:CafeLib.scpt of «script» wasn’t found.” number -43
Any ideas?
Update: The fix seems to be switching from “Macintosh HD:Users:elharo:Cafe Au Lait:support:CafeLib.scpt” to just “elharo:Cafe Au Lait:support:CafeLib.scpt”. The problem may not be Snow Leopard at all, but rather a concomitant encrypting of my home directory with FileVault. That seems to change what AppleScript sees as paths.
September 15th, 2009 at 11:28 AM
I always set them up as POSIX path objects. This is a quick from being a UNIX guy first (I’ve always found applescript’s colon syntax to be bad magic), but it has meant that all my scripts work in the change-over to snow leopard.
September 27th, 2009 at 11:50 PM
Thanks for this. I had also enabled FileVault, thus requiring the username:folder style path. Like yourself I had put it down to a Snow Leopard issue.