diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-10 11:32:28 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-10 11:32:28 +0200 |
| commit | c791858db3de3568f0ea2839c79b360a0dfb15ab (patch) | |
| tree | 7cf50c93cdf03075d10c14c8ad1f7a646b2a05c7 /QSThingsPlugin/Actions/SearchThingsAction.m | |
Initial commit
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 |