Permalink
Browse files

Added applescript support for a "search" command

  • Loading branch information...
1 parent 8e512d5 commit aa8db863fc27e6b592947795d55a4fbb9e40de64 @gregbell gregbell committed with Zachary Schneirov May 9, 2010
Showing with 64 additions and 0 deletions.
  1. +4 −0 Info.plist
  2. +13 −0 Notation.sdef
  3. +10 −0 Notation.xcodeproj/project.pbxproj
  4. +16 −0 SearchCommand.h
  5. +21 −0 SearchCommand.m
View
@@ -203,6 +203,10 @@
<real>345600</real>
<key>SUFeedURL</key>
<string>http://notational.net/nvupdates.xml</string>
+ <key>NSAppleScriptEnabled</key>
+ <true/>
+ <key>OSAScriptingDefinition</key>
+ <string>Notation.sdef</string>
<key>SmartCrashReports_CompanyName</key>
<string>Notational.net</string>
<key>SmartCrashReports_EmailTicket</key>
View
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
+<dictionary title="">
+ <suite name="Notational Velocity Scripting" code="nvss"
+ description="Commands and classes for Notational Velocity Scripting">
+ <command name="search" code="nvsssrch" description="Perform a search">
+ <cocoa class="SearchCommand"/>
+ <direct-parameter>
+ <type type="text" name="searchTerm"/>
+ </direct-parameter>
+ </command>
+ </suite>
+</dictionary>
@@ -152,6 +152,8 @@
21F459AD0A92E01D00FB6FFE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21F4599B0A92E01C00FB6FFE /* Carbon.framework */; };
21FF94F30B5AD22800DB6A2F /* ExporterManager.nib in Resources */ = {isa = PBXBuildFile; fileRef = 21FF94ED0B5AD22800DB6A2F /* ExporterManager.nib */; };
21FF94F70B5AD23B00DB6A2F /* ExporterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 21FF94F50B5AD23B00DB6A2F /* ExporterManager.m */; };
+ 57F27F7B11973A7F00C63ACF /* Notation.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 57F27F7A11973A7F00C63ACF /* Notation.sdef */; };
+ 57F27FB91197407400C63ACF /* SearchCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 57F27FB81197407400C63ACF /* SearchCommand.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
@@ -421,6 +423,9 @@
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32CA4F630368D1EE00C91783 /* Notation_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notation_Prefix.pch; sourceTree = "<group>"; };
+ 57F27F7A11973A7F00C63ACF /* Notation.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = Notation.sdef; sourceTree = "<group>"; };
+ 57F27FB71197407400C63ACF /* SearchCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchCommand.h; sourceTree = "<group>"; };
+ 57F27FB81197407400C63ACF /* SearchCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchCommand.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Notational Velocity.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Notational Velocity.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D3EEC9FE106F66C70023D7F8 /* NVPasswordGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NVPasswordGenerator.m; sourceTree = "<group>"; };
@@ -506,6 +511,8 @@
21B1BC351104D20E0004A7D0 /* InvocationRecorder.m */,
21F0793710EC5E21004FE56F /* Sync Services */,
212089CF0B0C2BCF00A15A69 /* Note Importing */,
+ 57F27FB71197407400C63ACF /* SearchCommand.h */,
+ 57F27FB81197407400C63ACF /* SearchCommand.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -769,6 +776,7 @@
21395BA90B7FDB5E007BCFAA /* Supporting Files */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
+ 57F27F7A11973A7F00C63ACF /* Notation.sdef */,
);
name = Notation;
sourceTree = "<group>";
@@ -941,6 +949,7 @@
21EA369B111C9AD900E2B517 /* Ceci est le titre d'une note.nvhelp in Resources */,
21EA369C111C9AD900E2B517 /* Contact.nvhelp in Resources */,
21E6EC21111DD52B0038ECC7 /* Comment ça marche.nvhelp in Resources */,
+ 57F27F7B11973A7F00C63ACF /* Notation.sdef in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1025,6 +1034,7 @@
21AD2850110BE99B00B7A985 /* SyncSessionController.m in Sources */,
212C6952110E1940004DD82C /* TitlebarButton.m in Sources */,
21B548FA112F307E00E163A1 /* NotationDirectoryManager.m in Sources */,
+ 57F27FB91197407400C63ACF /* SearchCommand.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -0,0 +1,16 @@
+//
+// SearchCommand.h
+// Notation
+//
+// Created by Greg D Bell on 9-5-10.
+// Copyright 2010 Orange Peel Media Ltd. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface SearchCommand : NSScriptCommand {
+
+}
+
+@end
View
@@ -0,0 +1,21 @@
+//
+// SearchCommand.m
+// Notation
+//
+// Created by Greg D Bell on 9-5-10.
+// Copyright 2010 Orange Peel Media Ltd. All rights reserved.
+//
+
+#import "SearchCommand.h"
+#import "AppController.h"
+
+@implementation SearchCommand
+
+- (id)performDefaultImplementation
+{
+ NSString *searchTerm = [self directParameter];
+ [(AppController *)[NSApp delegate] searchForString:searchTerm];
+ return self;
+}
+
+@end

0 comments on commit aa8db86

Please sign in to comment.