aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-10 13:47:24 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-10 13:47:24 +0000
commitbb99430f93b2e3c89c28cc44257635709f0fdd39 (patch)
tree74f2eb41f7942c1739641b01febf15f0d23dbfa7 /Source/SPAppController.m
parent169fb3fffeff55cff32952a82adba055dfc050f9 (diff)
downloadsequelpro-bb99430f93b2e3c89c28cc44257635709f0fdd39.tar.gz
sequelpro-bb99430f93b2e3c89c28cc44257635709f0fdd39.tar.bz2
sequelpro-bb99430f93b2e3c89c28cc44257635709f0fdd39.zip
• improved Bundle support; now it the passed input string will be saved as temp file SP_BUNDLE_INPUT_FILE since stdin and shell vars are difficult to handle for a large amount of data
• fixed AppleScript class definition since it was renamed • added support for the URL scheme 'sequel' to allow to interact with Sequel Pro eg via bash: open 'sequelpro://executequery=select%205' [not yet implemented ;)]
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m17
1 files changed, 17 insertions, 0 deletions
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];
@@ -499,6 +504,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
/**