Adding AppleScriptObjC to Existing Scripts
The script runs fine (assuming you have a file called
Test.txt
on your Desktop), until you uncomment theuse framework
line, 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 alias
instead of using a string that represents a path. I usually usePOSIX file "path"
, and that also works.