Adding AppleScriptObjC to Existing Scripts
The script runs fine (assuming you have a file called
Test.txton your Desktop), until you uncomment theuse frameworkline, after which you get the error: “Can’t make current application into type file.” That’s not very helpful.The solution is to change the code so you build file references using coercions.
In other words,
as aliasinstead of using a string that represents a path. I usually usePOSIX file "path", and that also works.