For these builds, Apple Events sent to "System Events.App" will fail
with -600 error codes unless these additional entitlements are granted:
<!-- Required for builds without SANDBOXING defined. -->
<key>com.apple.security.automation.apple-events</key>
<true/>
<!-- Required for sandboxed builds without SANDBOXING defined. -->
<key>com.apple.security.temporary-exception.apple-events</key>
<string>com.apple.systemevents</string>
(Of course, Apple might not grant these permissions for versions
submitted to the App Store.)
This is because Apple introduced more privacy measures in Mojave that
prohibit sandboxed apps from sending Apple events to other apps without
either a scripting-targets entitlement or an apple-events temporary exception entitlement.
However, "System Events.app" doesn't have any scripting entitlements
that we could use. Hence, we must use the latter.
"However, with App Sandbox you cannot send Apple events to other apps
unless you configure a scripting-targets entitlement or an apple-events
temporary exception entitlement."
https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AppSandboxTemporaryExceptionEntitlements.html
The below post also documented the issue and solution in more details:
https://www.jessesquires.com/blog/2018/11/17/executing-applescript-in-mac-app-on-macos-mojave/
Rewrote RoundRecTextField to allow Auto Layout with leading
and trailing margins to dynamically size the 'n of m' bubble
which lays the groundwork for supporting 999 clippings without
looking bad. RoundRecTextField was pretty self-critical anyway.
The 'n of m' bubble was off-center previously, so now it is centered.
The bezel content was lacking in margins to the background shading,
so those have been fixed up now.
Saving to the Desktop like Screen Shot sounded great at the time,
and I turn of Desktop icons so it didn't bother me, but really it
was a mess and a bit silly considering the number of autosave
clippings that can be produced. So it is time to create year and
month directories to organize them.
Manually saved clippings don't get year and month directories
because they are an explicit user action and the user can handle
them (and might well not want to have to hunt for them).
Surely some users will want year/month/day directories, and some
only year. Perhaps some none. I can't bring myself to make the
settings panel more complicated, so year/month seemed to strike
a balance.
This cleans up inconsistencies in the layout and makes it more
durable. It retains the 4px spacing between rows even though that
is lower than standard spacing.
Per https://twitter.com/vishalmalvi_/status/1475835430067052546?s=12
"YYYY" represents a so called 'week year'
"yyyy" represents a four-digit calendar year
They aren't the same. This has caused clippings near the end of the
year to be saved with the following year number rather than the
current year number.
The bezel doesn't provide any UI indication when it loses focus and
this no longer responds to input. This ranges anywhere from being
klunky to being a bug. Users have reported that they believed Flycut
to have hung when encountering this.
This defines a protocol for the BezelWindow's delegate, which had
previously just been a blind id delegate and makes the new delegate
inherit from NSWindowDelegate so that AppController can receive
windowDidResignKey: to indicate when focus is lost and immediately
close the bezel.