mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 17:38:38 +00:00
Merge pull request #139 from ReDetection/apple-script-robustness
Stable AppleScript
This commit is contained in:
commit
154ea09e98
@ -9,13 +9,19 @@ class AppleScriptTouchBarItem: CustomButtonTouchBarItem {
|
|||||||
self.interval = interval
|
self.interval = interval
|
||||||
super.init(identifier: identifier, title: "⏳")
|
super.init(identifier: identifier, title: "⏳")
|
||||||
forceHideConstraint = view.widthAnchor.constraint(equalToConstant: 0)
|
forceHideConstraint = view.widthAnchor.constraint(equalToConstant: 0)
|
||||||
|
title = "scheduled"
|
||||||
|
DispatchQueue.appleScriptQueue.async {
|
||||||
guard let script = source.appleScript else {
|
guard let script = source.appleScript else {
|
||||||
title = "no script"
|
DispatchQueue.main.async {
|
||||||
|
self.title = "no script"
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.script = script
|
self.script = script
|
||||||
isBordered = false
|
DispatchQueue.main.async {
|
||||||
DispatchQueue.appleScriptQueue.async {
|
self.isBordered = false
|
||||||
|
}
|
||||||
|
|
||||||
var error: NSDictionary?
|
var error: NSDictionary?
|
||||||
guard script.compileAndReturnError(&error) else {
|
guard script.compileAndReturnError(&error) else {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user