This repository has been archived by the owner on Jun 23, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2.7 - Fix bug that causes MAL Updater OS X to crash when Plex/Kodi …
…support is enabled. Add Applescripting support
- Loading branch information
chikorita157
committed
Jun 29, 2015
1 parent
2155db6
commit d8cc38c
Showing
10 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> | ||
|
||
<dictionary title="MAL Updater OS X"> | ||
<suite name="MAL Updater OS X Suite" code="HaAp" description="MAL Updater OS X AppleScript support"> | ||
<command name="getstatus" code="GetStatu" description="Returns the currently playing status information."> | ||
<cocoa class="ScriptingGetStatus"/> | ||
<result type="text" description="Currently playing information in JSON. If there is nothing playing, it will return a blank array." /> | ||
</command> | ||
<command name="scrobblenow" code="Scrobble" description="Tells MAL Updater OS X to perform an on demand scrobble."> | ||
<cocoa class="ScriptingScrobbleNow"/> | ||
</command> | ||
<command name="toggleautoscrobble" code="toggleas" description="Tells MAL Updater OS X to toggle the auto scrobble state."> | ||
<cocoa class="ScriptingToggleAutoScrobble"/> | ||
</command> | ||
</suite> | ||
</dictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-361 Bytes
(100%)
...odeproj/project.xcworkspace/xcuserdata/tailred.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// MALScripting.h | ||
// MAL Updater OS X | ||
// | ||
// Created by Tail Red on 6/19/15. | ||
// Copyright 2015 Atelier Shiori. All rights reserved. Code licensed under New BSD License | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface ScriptingGetStatus: NSScriptCommand | ||
|
||
@end | ||
|
||
@interface ScriptingScrobbleNow: NSScriptCommand | ||
|
||
@end | ||
|
||
@interface ScriptingToggleAutoScrobble: NSScriptCommand | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// MALScripting.m | ||
// MAL Updater OS X | ||
// | ||
// Created by Tail Red on 6/19/15. | ||
// Copyright 2015 Atelier Shiori. All rights reserved. Code licensed under New BSD License | ||
// | ||
|
||
#import "MALScripting.h" | ||
#import "MAL_Updater_OS_XAppDelegate.h" | ||
|
||
@implementation ScriptingGetStatus | ||
// AppleScript command for GetStatus | ||
-(id)performDefaultImplementation { | ||
MAL_Updater_OS_XAppDelegate * delegate = (MAL_Updater_OS_XAppDelegate *)[[NSApplication sharedApplication] delegate]; | ||
NSError *error; | ||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[delegate getNowPlaying] options:0 error:&error]; | ||
if (!jsonData) {} | ||
else{ | ||
NSString *JSONString = [[NSString alloc] initWithBytes:[jsonData bytes] length:[jsonData length] encoding:NSUTF8StringEncoding]; | ||
// Output JSON | ||
return JSONString; | ||
} | ||
return @""; | ||
} | ||
@end | ||
|
||
@implementation ScriptingScrobbleNow | ||
// AppleScript command for ScrobbleNow | ||
-(id)performDefaultImplementation { | ||
MAL_Updater_OS_XAppDelegate * delegate = (MAL_Updater_OS_XAppDelegate *)[[NSApplication sharedApplication] delegate]; | ||
[delegate updatenow:nil]; | ||
return nil; | ||
} | ||
@end | ||
|
||
@implementation ScriptingToggleAutoScrobble | ||
// AppleScript command for ToggleAutoScrobble | ||
-(id)performDefaultImplementation{ | ||
MAL_Updater_OS_XAppDelegate * delegate = (MAL_Updater_OS_XAppDelegate *)[[NSApplication sharedApplication] delegate]; | ||
[delegate toggletimer:nil]; | ||
return nil; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters