From bb99430f93b2e3c89c28cc44257635709f0fdd39 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 10 Nov 2010 13:47:24 +0000 Subject: =?UTF-8?q?=E2=80=A2=20improved=20Bundle=20support;=20now=20it=20t?= =?UTF-8?q?he=20passed=20input=20string=20will=20be=20saved=20as=20temp=20?= =?UTF-8?q?file=20SP=5FBUNDLE=5FINPUT=5FFILE=20since=20stdin=20and=20shell?= =?UTF-8?q?=20vars=20are=20difficult=20to=20handle=20for=20a=20large=20amo?= =?UTF-8?q?unt=20of=20data=20=E2=80=A2=20fixed=20AppleScript=20class=20def?= =?UTF-8?q?inition=20since=20it=20was=20renamed=20=E2=80=A2=20added=20supp?= =?UTF-8?q?ort=20for=20the=20URL=20scheme=20'sequel'=20to=20allow=20to=20i?= =?UTF-8?q?nteract=20with=20Sequel=20Pro=20eg=20via=20bash:=20open=20'sequ?= =?UTF-8?q?elpro://executequery=3Dselect%205'=20[not=20yet=20implemented?= =?UTF-8?q?=20;)]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/SPAppController.m') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index b2876af4..4b5b997c 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -60,6 +60,7 @@ { // Register application defaults [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PreferenceDefaults" ofType:@"plist"]]]; + } /** @@ -67,6 +68,10 @@ */ - (void)awakeFromNib { + + // Register url scheme handle + [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; + // Set up the prefs controller prefsController = [[SPPreferenceController alloc] init]; @@ -498,6 +503,18 @@ } } +#pragma mark - +#pragma mark URL scheme handler + +/** + * “sequelpro://” url dispatcher + */ +- (void)handleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +{ + NSURL *url = [NSURL URLWithString:[[event paramDescriptorForKeyword:keyDirectObject] stringValue]]; + NSLog(@"url = %@", url); +} + #pragma mark - #pragma mark Window management -- cgit v1.2.3