Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange error running osascript -e [command] on macOS Mojave

I've just done a clean install of macOS Mojave (albeit various bits and pieces reinstalled) and getting a strange error running a bash script which in turn runs AppleScript via osascript. Any command passed to osascript -e seems to produce the same error, even though the actual command appears to complete.

e.g. $ osascript -e 'say "hello"'

Error is:

2018-12-03 22:35:26.301 osascript[39652:590470] isPrefsCreateCacheFromEnabledAndDefaultInputSources - can't find anything from GetInputSourceEnabledPrefs, use defaultASCIIKeyLayoutDict = {type = mutable dict, count = 3,
entries =>
0 : {contents = "InputSourceKind"} = {contents = "Keyboard Layout"}
1 : {contents = "KeyboardLayout ID"} = {value = +2, type = kCFNumberSInt64Type}
9 : {contents = "KeyboardLayout Name"} = British
}

Running the same command via the ScriptEditor application works fine.

Using system bash, one keyboard configured at install (British).

Anyone have the same issue or idea what the problem is?

like image 536
Claire Furney Avatar asked Dec 03 '18 23:12

Claire Furney


People also ask

Why can't I use 1Password in Mojave?

1Password is using the Apple scripting architecture to handle some things. Mojave has tightened security which may be restricting some actions until you approve them. The 1Password developers should know what you need to do.

How to run an AppleScript from the shell?

The osascript tool can run compiled Apple Scripts or even plain text files. You have something trying to make changes using the Open Scripting Architecture. Open Scripting Architecture - Developer - Apple osascript is a command to run a script (AppleScript, JavaScript) from the shell.

How to detect a Trojan on a Mac?

The primary method which you can use to detect a Trojan is to analyse hidden processes on your Mac This is achievable by downloading process monitoring apps, like Process Explorer. However, you will have to have a trained eye on how to detect the malicious processes and how to remove those without damaging your Mac.

How do I get rid of Osahon virus completely?

Remove any Osascript Virus presence from Google Chrome. Open Chrome and click on the drop-down menu at the top-right corner. From the menu open “Tools” and click on “Extensions”. Find any Osascript Virus – related add-ons and extensions and click on the garbage icon to remove them.


1 Answers

The issue went away when I added an extra keyboard via System Preferences > Keyboard > Input Sources. (Australian if anyone is interested.)

The issue stayed away after removing the extra keyboard. (I sporadically need the £.)

Report logged with Apple.

like image 164
Claire Furney Avatar answered Sep 21 '22 08:09

Claire Furney