diff options
Diffstat (limited to 'QSThingsPlugin/Actions/SearchThingsAction.m')
| -rw-r--r-- | QSThingsPlugin/Actions/SearchThingsAction.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/QSThingsPlugin/Actions/SearchThingsAction.m b/QSThingsPlugin/Actions/SearchThingsAction.m new file mode 100644 index 0000000..9b042b3 --- /dev/null +++ b/QSThingsPlugin/Actions/SearchThingsAction.m @@ -0,0 +1,24 @@ +#import "SearchThingsAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SearchThingsAction + +- (QSObject *)searchFor:(QSObject *)directObject +{ + + NSString *contents = [directObject displayName]; + if (contents) { + NSString *urlString = [NSString stringWithFormat:@"things:///search?query=%@", contents]; + NSURL *url = [NSURL URLWithString:urlString]; + + [[NSWorkspace sharedWorkspace] openURL:url]; + } else { + NSLog(@"Could not get the text of the Things object."); + } + return directObject; +} + +@end + +NS_ASSUME_NONNULL_END |