I'm upgrading Applescripts that worked in Snow Leopard but fail in Yosemite.
I've tracked down one problem to the Finder's "duplicate" command. When the reference is to a file on a network share mounted using SMB, it no longer appears to return a reference to the duplicated object. I think this might be a bug in Yosemite's OSAX implementation, but I haven't come up with a workaround yet.
set testPath to "MyVolume:Path:To:File:testfile.txt"
tell application "Finder"
set fileRef to duplicate (testPath as alias)
log fileRef as string
end tell
On a Yosemite Mac, the duplicate command works to create a duplicate, but the returned fileRef is undefined. At the location of the log line, I get the error: The variable fileRef is not defined.
On a Snow Leopard Mac, the duplicate command works to create a duplicate, and the returned fileRef variable is fine. The console log output is: MyVolume:Path:To:File:testfile copy.txt
The Finder dictionary on the Yosemite machine says:
duplicate v : Duplicate one or more object(s)
[...]
→ specifier : to the duplicated object(s)
The duplicate command is supposed to return the specifier, but it no longer does.
Has anyone else run into this problem? Am I missing something? Is there a workaround?
Thanks!