Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds another command to the applescript dictionary to the example app…

…lication.
  • Loading branch information...
commit db4a87b3be1336e8b406f3dd551c20a23a54e0dd 1 parent b117390
Grayson Hansard authored
9 ExampleApplication/ExampleApplication.sdef
View
@@ -401,6 +401,9 @@ SUCH DAMAGE.
<cocoa name="ExampleApplication"/>
<class name="application" code="capp" inherits="application">
<cocoa class="NSApplication"/>
+ <responds-to name="run script">
+ <cocoa method="ASRunScript:"/>
+ </responds-to>
</class>
<command name="action property" code="exPMXprp">
<result type="text"/>
@@ -432,5 +435,11 @@ SUCH DAMAGE.
</parameter>
<result type="any"/>
</command>
+ <command name="run script" code="exPMrNSc" description="Run a script at a given path.">
+ <direct-parameter description="The file or a path to the file to execute.">
+ <type type="file"/>
+ <type type="text"/>
+ </direct-parameter>
+ </command>
</suite>
</dictionary>
14 ExampleApplication/ExampleApplication.xcodeproj/ghansard.mode1v3
View
@@ -250,6 +250,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -288,22 +290,19 @@
<string>29B97314FDCFA39411CA2CEA</string>
<string>1DC323CE0F3B77B40011E197</string>
<string>1DC3242A0F3B86790011E197</string>
+ <string>080E96DDFE201D6D7F000001</string>
<string>1C37FBAC04509CD000000102</string>
<string>1DD73A340F3C9F0400552B38</string>
- <string>1DD73B300F3CA0EC00552B38</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>24</integer>
- <integer>23</integer>
- <integer>18</integer>
- <integer>17</integer>
+ <integer>30</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {186, 338}}</string>
+ <string>{{0, 308}, {186, 338}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -524,7 +523,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>255654198.51406601</real>
+ <real>255655452.46238601</real>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
@@ -539,6 +538,7 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>1DD73C6F0F3CFBE100552B38</string>
<string>1C530D57069F1CE1000CFCEE</string>
<string>1DD73B9B0F3CCA0A00552B38</string>
<string>1DD73B9C0F3CCA0A00552B38</string>
65 ExampleApplication/ExampleApplication.xcodeproj/ghansard.pbxuser
View
@@ -39,6 +39,20 @@
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
+ 1DC322F70F3B74FA0011E197 /* ApplescriptPluginManager.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {439, 420}}";
+ sepNavSelRange = "{747, 0}";
+ sepNavVisRange = "{397, 350}";
+ };
+ };
+ 1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {439, 1806}}";
+ sepNavSelRange = "{3841, 0}";
+ sepNavVisRange = "{308, 474}";
+ };
+ };
1DC322FA0F3B74FA0011E197 /* FScriptPlugInManager.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {439, 1554}}";
@@ -253,12 +267,51 @@
vrLen = 623;
vrLoc = 2479;
};
+ 1DD73C7A0F3CFE1A00552B38 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 1DC322F70F3B74FA0011E197 /* ApplescriptPluginManager.h */;
+ name = "ApplescriptPluginManager.h: 27";
+ rLen = 0;
+ rLoc = 747;
+ rType = 0;
+ vrLen = 350;
+ vrLoc = 397;
+ };
+ 1DD73C7B0F3CFE1A00552B38 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ comments = "error: 'infoDictionary' undeclared (first use in this function)";
+ fRef = 1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */;
+ rLen = 1;
+ rLoc = 16;
+ rType = 1;
+ };
+ 1DD73C7C0F3CFE1A00552B38 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 1DC322F70F3B74FA0011E197 /* ApplescriptPluginManager.h */;
+ name = "ApplescriptPluginManager.h: 27";
+ rLen = 0;
+ rLoc = 747;
+ rType = 0;
+ vrLen = 350;
+ vrLoc = 397;
+ };
+ 1DD73C7D0F3CFE1A00552B38 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */;
+ name = "ApplescriptPluginManager.m: 116";
+ rLen = 0;
+ rLoc = 3841;
+ rType = 0;
+ vrLen = 474;
+ vrLoc = 308;
+ };
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeArchitecture = i386;
activeBuildConfigurationName = Debug;
activeExecutable = 1DC322E60F3B74730011E197 /* ExampleApplication */;
activeTarget = 8D1107260486CEB800E47090 /* ExampleApplication */;
addToTargets = (
+ 8D1107260486CEB800E47090 /* ExampleApplication */,
);
breakpoints = (
1DD73B870F3CC97C00552B38 /* malloc_error_break */,
@@ -382,6 +435,10 @@
1DD73C390F3CDA1800552B38 /* PBXTextBookmark */ = 1DD73C390F3CDA1800552B38 /* PBXTextBookmark */;
1DD73C3A0F3CDA1800552B38 /* PBXTextBookmark */ = 1DD73C3A0F3CDA1800552B38 /* PBXTextBookmark */;
1DD73C3B0F3CDA1800552B38 /* PBXTextBookmark */ = 1DD73C3B0F3CDA1800552B38 /* PBXTextBookmark */;
+ 1DD73C7A0F3CFE1A00552B38 /* PBXTextBookmark */ = 1DD73C7A0F3CFE1A00552B38 /* PBXTextBookmark */;
+ 1DD73C7B0F3CFE1A00552B38 /* PBXTextBookmark */ = 1DD73C7B0F3CFE1A00552B38 /* PBXTextBookmark */;
+ 1DD73C7C0F3CFE1A00552B38 /* PBXTextBookmark */ = 1DD73C7C0F3CFE1A00552B38 /* PBXTextBookmark */;
+ 1DD73C7D0F3CFE1A00552B38 /* PBXTextBookmark */ = 1DD73C7D0F3CFE1A00552B38 /* PBXTextBookmark */;
};
sourceControlManager = 1DC322F40F3B747D0011E197 /* Source Control */;
userBuildSettings = {
@@ -393,4 +450,12 @@
1DC322E60F3B74730011E197 /* ExampleApplication */,
);
};
+ 8D1107310486CEB800E47090 /* Info.plist */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {736, 751}}";
+ sepNavSelRange = "{611, 17}";
+ sepNavVisRange = "{0, 971}";
+ sepNavWindowFrame = "{{15, 9}, {795, 864}}";
+ };
+ };
}
8 ExampleApplication/ExampleApplication.xcodeproj/project.pbxproj
View
@@ -38,6 +38,8 @@
1DD73C2C0F3CD9A700552B38 /* NSApplescript+FCSAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC323600F3B75910011E197 /* NSApplescript+FCSAdditions.m */; };
1DD73C300F3CD9C800552B38 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DC323BD0F3B76C40011E197 /* Carbon.framework */; };
1DD73C5A0F3CF93500552B38 /* Example.py in Copy plugins */ = {isa = PBXBuildFile; fileRef = 1D973F310F3BF36000437B6D /* Example.py */; };
+ 1DD73C610F3CFA9F00552B38 /* NSApplication+Applescript.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DD73C600F3CFA9F00552B38 /* NSApplication+Applescript.m */; };
+ 1DD73C6D0F3CFBDE00552B38 /* ApplescriptPluginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -124,6 +126,8 @@
1DD73C050F3CD7F200552B38 /* Example.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = Example.js; sourceTree = "<group>"; };
1DD73C090F3CD82400552B38 /* Example.fscript */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Example.fscript; sourceTree = "<group>"; };
1DD73C0B0F3CD83E00552B38 /* Example.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Example.nu; sourceTree = "<group>"; };
+ 1DD73C5F0F3CFA9F00552B38 /* NSApplication+Applescript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+Applescript.h"; sourceTree = "<group>"; };
+ 1DD73C600F3CFA9F00552B38 /* NSApplication+Applescript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+Applescript.m"; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
@@ -167,6 +171,8 @@
children = (
1DC323EA0F3B795E0011E197 /* ExampleController.h */,
1DC323EB0F3B795E0011E197 /* ExampleController.m */,
+ 1DD73C5F0F3CFA9F00552B38 /* NSApplication+Applescript.h */,
+ 1DD73C600F3CFA9F00552B38 /* NSApplication+Applescript.m */,
);
name = Classes;
sourceTree = "<group>";
@@ -416,6 +422,8 @@
1DD73C060F3CD7F200552B38 /* Example.js in Sources */,
1DD73C2B0F3CD9A300552B38 /* FScriptPlugInManager.m in Sources */,
1DD73C2C0F3CD9A700552B38 /* NSApplescript+FCSAdditions.m in Sources */,
+ 1DD73C610F3CFA9F00552B38 /* NSApplication+Applescript.m in Sources */,
+ 1DD73C6D0F3CFBDE00552B38 /* ApplescriptPluginManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
16 ExampleApplication/NSApplication+Applescript.h
View
@@ -0,0 +1,16 @@
+//
+// NSApplication+Applescript.h
+// ExampleApplication
+//
+// Created by Grayson Hansard on 2/6/09.
+// Copyright 2009 From Concentrate Software. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "PluginManager.h"
+
+@interface NSApplication (Applescript)
+
+- (id)ASRunScript:(NSScriptCommand *)aScriptCommand;
+
+@end
19 ExampleApplication/NSApplication+Applescript.m
View
@@ -0,0 +1,19 @@
+//
+// NSApplication+Applescript.m
+// ExampleApplication
+//
+// Created by Grayson Hansard on 2/6/09.
+// Copyright 2009 From Concentrate Software. All rights reserved.
+//
+
+#import "NSApplication+Applescript.h"
+
+
+@implementation NSApplication (Applescript)
+
+- (id)ASRunScript:(NSScriptCommand *)aScriptCommand {
+ NSString *path = [aScriptCommand directParameter];
+ return [PluginManager runScriptAtPath:path];
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.