Skip to content

Commit

Permalink
Mac OS 10.14 and Omnifocus 3
Browse files Browse the repository at this point in the history
  • Loading branch information
devon committed Oct 1, 2018
1 parent 84af70f commit 8e301e0
Show file tree
Hide file tree
Showing 23 changed files with 120 additions and 165 deletions.
213 changes: 73 additions & 140 deletions Mac OS X/Eggscellent.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Mac OS X/pomodorable/Controllers/OmniFocusSyncController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ - (id)init

- (BOOL)sync
{
NSArray *runningApps1 = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.omnigroup.OmniFocus2"];
NSArray *runningApps2 = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.omnigroup.OmniFocus2.MacAppStore"];
NSArray *runningApps1 = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.omnigroup.OmniFocus3"];
NSArray *runningApps2 = [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.omnigroup.OmniFocus3.MacAppStore"];

if ([runningApps1 count] == 0 && [runningApps2 count] == 0)
return NO;
Expand Down Expand Up @@ -120,12 +120,12 @@ - (void)syncActivity:(Activity *)activity
NSString *statusString = (activity.completed || [activity.removed boolValue]) ? @"true" : @"false";
NSString *activityID = [activity.sourceID copy];
NSString *nameString = activity.name;
[[ScriptManager sharedManager] executeScript:scriptName withParameters:[NSArray arrayWithObjects:activityID, statusString, nameString, nil]];
[[ScriptManager sharedManager] executeScript:scriptName withParameters:[NSArray arrayWithObjects:activityID, nameString, activityID, statusString, nil]];
}

- (NSString *)appID
{
return @"com.omnigroup.OmniFocus2";
return @"com.omnigroup.OmniFocus3";
}

@end
13 changes: 7 additions & 6 deletions Mac OS X/pomodorable/Controllers/ScriptManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (id)init

- (NSAppleEventDescriptor *)executeSource:(NSString *)scriptId
{
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"applescript"];
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"ascript"];
if(!url)
return nil;
NSString *source = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL];
Expand All @@ -56,7 +56,8 @@ - (NSAppleEventDescriptor *)executeScript:(NSString*) scriptId
NSAppleScript* applescript = [scripts objectForKey:scriptId];
if (nil == applescript)
{
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"applescript"];
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"ascript"];

if(!url)
return nil;

Expand Down Expand Up @@ -86,7 +87,7 @@ - (NSAppleEventDescriptor *)executeScript:(NSString *)scriptId withParameter:(NS
NSError *error = nil;
if (nil == scriptText)
{
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"applescript"];
NSURL *url = [[NSBundle mainBundle] URLForResource:scriptId withExtension:@"ascript"];

scriptText = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
[scripts setObject:scriptText forKey:scriptId];
Expand All @@ -107,15 +108,15 @@ - (NSAppleEventDescriptor *)executeScript:(NSString *)scriptId withParameters:(N
NSString* scriptText = [scripts objectForKey:scriptId];
if (nil == scriptText)
{
NSString* scriptFileName = [[NSBundle mainBundle] pathForResource: scriptId ofType: @"applescript"];
NSString* scriptFileName = [[NSBundle mainBundle] pathForResource: scriptId ofType: @"ascript"];
NSError *error;
scriptText = [[NSString alloc] initWithContentsOfURL:[NSURL fileURLWithPath: scriptFileName] encoding:NSUTF8StringEncoding error:&error];
[scripts setObject:scriptText forKey:scriptId];
}

for(NSString *parameter in parameters)
{
NSRange range = [scriptText rangeOfString:@"¡"];
NSRange range = [scriptText rangeOfString:@""];
scriptText = [scriptText stringByReplacingCharactersInRange:range withString:parameter];
}

Expand All @@ -126,4 +127,4 @@ - (NSAppleEventDescriptor *)executeScript:(NSString *)scriptId withParameters:(N
return retValue;
}

@end
@end
2 changes: 2 additions & 0 deletions Mac OS X/pomodorable/Eggscellent-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppleEventsUsageDescription</key>
<string>Please give Unread Mail access to Mail via Apple Script.</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions Mac OS X/pomodorable/Eggscellent.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.omnigroup.OmniFocus2.MacAppStore</string>
<string>com.omnigroup.OmniFocus2</string>
<string>com.omnigroup.OmniFocus3.MacAppStore</string>
<string>com.omnigroup.OmniFocus3</string>
<string>com.culturedcode.things</string>
<string>com.skype.skype</string>
<string>com.adiumx.adiumx</string>
Expand Down
4 changes: 2 additions & 2 deletions Mac OS X/pomodorable/EggscellentClassic.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.omnigroup.OmniFocus2.MacAppStore</string>
<string>com.omnigroup.OmniFocus2</string>
<string>com.omnigroup.OmniFocus3.MacAppStore</string>
<string>com.omnigroup.OmniFocus3</string>
<string>com.culturedcode.things</string>
<string>com.skype.skype</string>
<string>com.adiumx.adiumx</string>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
tell application "OmniFocus"
tell default document
tell (flattened tasks whose id is equal to "✅")
set name to "✅"
end tell

repeat with anItem in (flattened tasks whose id is equal to "✅")
if ✅
mark complete anItem
else
mark incomplete anItem
end if
end repeat
end tell
end tell
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tell application "OmniFocus"
tell default document
tell (flattened tasks whose id is equal to "✅")
set name to "✅"
end tell
repeat with anItem in (flattened tasks whose id is equal to "✅")
if ✅
mark complete anItem
else
mark incomplete anItem
end if
end repeat
end tell
end tell
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
eggscellent
===========

Add Omnifucos 2 sync support, Downlad at <https://github.com/devon/eggscellent/releases>

You need OmniFocus pro for task integration. Because eggscellent use apple script to support OmniFocus pro.
Test on Mac OS 10.14 and Omnifocus3

0 comments on commit 8e301e0

Please sign in to comment.