From c791858db3de3568f0ea2839c79b360a0dfb15ab Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Wed, 10 Sep 2025 11:32:28 +0200 Subject: Initial commit --- QSThingsPlugin/Actions/SearchThingsAction.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 QSThingsPlugin/Actions/SearchThingsAction.m (limited to 'QSThingsPlugin/Actions/SearchThingsAction.m') 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 -- cgit