System Events problem with Mojave (10.14)
System Events problem with Mojave (10.14)
- Subject: System Events problem with Mojave (10.14)
- From: David Crowe <email@hidden>
- Date: Fri, 19 Apr 2019 20:19:17 -0600
I use FastScripts a lot just to associate a hot key with an AppleScript, and
one of my scripts uses System Events to paste from the clipboard. A simple
example (that strips formatting from the clipboard text):
set x to the clipboard
if x = "" then return
set the clipboard to (x as string)
tell application "System Events"
try
keystroke "v" using {command down}
on error errmsg number errnum
display dialog "Cannot paste. " & errmsg & " (" & errnum & ")"
end try
end tell
I get three different results:
1. It works (only sometimes)
2. Script Editor is not allowed to send keystrokes. (code 1002)
3. I get a dialog box telling me that FastScripts is not allowed to modify
keystrokes (can’t remember the exact message) and I must go to System
Preferences.
In System Preferences I have FastScripts (and Script Editor) included, with the
checkbox checked, under Accessibility. If I run the script from Script Editor
(or Smile) I get the same error.
In my last testing I got error 3 once, then error 2 about half a dozen times,
then it started working, then it went back to error 2.
- David Crowe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden