Broken AppleScript in Lion (“can’t get container of file”)
I’m excerpting from a script that used to work well in SL but is now broken in Lion:
tell application "BBEdit"
set theOriginalFile to file of document 1
tell application "Finder"
set c to get container of theOriginalFile
return c
end tell
end tell
It used to return the path to the document, but now it generates an error: “Finder got an error: Can’t get container of file [path to the file].”
It’s not clear what the problem is. Also, it would be great if Apple (or someone) could compile a list of things that break in AppleScript under Lion and how to fix them.
MacBook Pro, Mac OS X (10.7)