-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add AppleScript support for turning Scroll Reverser on and off
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Application.h | ||
// ScrollReverser | ||
// | ||
// Created by Nicholas Moore on 09/12/2014. | ||
// | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface Application : NSApplication | ||
|
||
@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,23 @@ | ||
// | ||
// Application.m | ||
// ScrollReverser | ||
// | ||
// Created by Nicholas Moore on 09/12/2014. | ||
// | ||
// | ||
|
||
#import "Application.h" | ||
#import "AppDelegate.h" | ||
|
||
@implementation Application | ||
|
||
- (NSNumber*)enabled { | ||
BOOL enabled=[[NSUserDefaults standardUserDefaults] boolForKey:PrefsReverseScrolling]; | ||
return @(enabled); | ||
} | ||
|
||
- (void)setEnabled:(NSNumber*)state { | ||
[[NSUserDefaults standardUserDefaults] setBool:[state boolValue] forKey:PrefsReverseScrolling]; | ||
} | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> | ||
|
||
|
||
<!-- declare the namespace for using XInclude so we can include the standard suite --> | ||
<dictionary xmlns:xi="http://www.w3.org/2003/XInclude"> | ||
|
||
|
||
<!-- use XInclude to include the standard suite --> | ||
<xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/> | ||
|
||
|
||
<!-- our special scripting suite --> | ||
<suite name="Scroll Reverser Suite" code="SRSR" | ||
description="Scroll Reverser application specific scripting facilities."> | ||
|
||
|
||
<!-- any additions to the application class are done here. note that | ||
we have specified that we inherit all of the properties from the standard | ||
application class definition, and we use the same four character code from | ||
that definition (see the application class definition above). --> | ||
<class name="application" code="capp" | ||
description="Scroll Reverser application." inherits="application"> | ||
|
||
<!-- the name of the Cocoa class where we have provided the | ||
various accessor methods for our application class. --> | ||
<cocoa class="NSApplication"/> | ||
|
||
<property name="enabled" code="SRen" type="boolean" description="Set whether Scroll Reverser is on or off."/> | ||
</class> | ||
|
||
|
||
</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