OSA Script failing for JavaScript All the Sudden

alfredapplescriptautomation

I'm running a simple Alfred 3 workflow as I always have but the osascript portion of it is failing all the sudden. I've restarted my machine and of course Alfred 3. This is the error I get in the debug panel: [ERROR: action.script] osascript: no such component "JavaScript".

I'm on OSX 10.12.5


If it helps, I actually submitted the question to Alfred first and they sent me here, see the original Alfred forum post: https://www.alfredforum.com/topic/11058-osa-script-failing-for-javascript-all-the-sudden/?tab=comments#comment-57404

Best Answer

For those who may experience this issue in the future, I was able to resolve the issue by deleting the /Users/your short name/Library/Preferences/com.apple.ScriptEditor2.plist file and rebooting. I can only assume this file must have somehow become corrupted and it kept the JXA option from being accessible as a script type.