Skip to content

Commit

Permalink
Fix crash with unmatched errors
Browse files Browse the repository at this point in the history
  • Loading branch information
melchor629 committed Oct 14, 2018
1 parent bbbaab5 commit 98b3c2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion iTunes Scrobbler/AppleScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AppleScript {
if line[2].first! == "\"" && line[2].last! == "\"" {
let start = line[2].index(line[2].startIndex, offsetBy: 1)
let end = line[2].index(line[2].endIndex, offsetBy: -1)
res[line[1]] = line[2][start..<end]
res[line[1]] = String(line[2][start..<end])
} else {
res[line[1]] = line[2]
}
Expand Down
1 change: 1 addition & 0 deletions iTunes Scrobbler/services/iTunesService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ end tell

private func checkAppleScriptPermission() {
if #available(macOS 10.14, *) {
if !isRunning { return }
//See https://www.felix-schwarz.org/blog/2018/08/new-apple-event-apis-in-macos-mojave
let desc = NSAppleEventDescriptor(bundleIdentifier: "com.apple.iTunes").aeDesc!
let status = AEDeterminePermissionToAutomateTarget(desc, 0x61657674, typeWildCard, true)
Expand Down

0 comments on commit 98b3c2e

Please sign in to comment.