osacompile: no such component "AppleScript"

Apple Recommended

  • Removing ~/Library/Components/Script Debugger.component did it for me as well. Thank you!

Add a Comment

Replies

I think this is just your system. I just repeated your test here and things work as expected:

Code Block
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.5
BuildVersion: 19F101
% cat test.applescript
display dialog "Hello Cruel World!"
% /usr/bin/osacompile -l AppleScript -d -o test.scpt test.applescript
% osascript test.scpt
«class bhit»:OK


If you create a new user and then log in as that user, do you still see the problem?

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 22 Jun through to Fri, 26 Jun. During that time all of DTS will be busy with conference duties.
Wow.. it indeed works when I log in as a new user.

So something must be wrong with the osascript preferences in my account, right?
Do you know where osascript's preferences are stored?

So something must be wrong with the osascript preferences in my account, right?

It certainly seems that way.

Do you know where osascript’s preferences are stored?

No, sorry.

In situations like this I’ve been known to run the code under fs_usage (see its man page) to see what files it accesses and see if there’s any obvious problem with them.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
  • Removing ~/Library/Components/Script Debugger.component did it for me as well. Thank you!

Add a Comment
I hit this too, but blowing out the script debugger component fixed it. And the recreated component didn't cause any problems. So looks like that's a good fix for the osacompile issue.

One thing I noticed is that when I ran osalang -l, the system was VERY confused about what languages it actually had. doing the remove and renew with the SD component fixed that as well.

I was having this problem:

osacompile: no such component "AppleScript".

and removing ~/Library/Components/Script Debugger.component fixed it for me too!

Thanks!

This worked for me, too. I ran

sudo fs_usage -w -f filesys osascript 

in one terminal window, and then ran my applescript command (in my case it was for the odrive file sync setup program)

echo 'open location "http://www.odrive.com"' | osascript 

in another terminal window. I looked at the output in the first window and sure enough, a random component was mentioned several times. Using the path listed, I deleted

 ~/Library/Audio/Plug-Ins/Components/Guitar Rig 5.component 

and then everything worked. Thanks so much for the detailed troubleshooting instructions!