Skip to content
Browse files

Incremental changes to the ExampleApplication as well as updates to t…

…he plugin managers.
  • Loading branch information...
1 parent 7eaf590 commit 3d730367db4509c8b966d1e1eca56079e49bc152 @Grayson committed
View
245 ExampleApplication/English.lproj/MainMenu.nib/designable.nib
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
<data>
- <int key="IBDocument.SystemTarget">0</int>
+ <int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">9F33</string>
<string key="IBDocument.InterfaceBuilderVersion">644</string>
<string key="IBDocument.AppKitVersion">949.34</string>
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="371"/>
<integer value="29"/>
+ <integer value="372"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -764,6 +764,106 @@
<object class="NSView" key="NSWindowView" id="439893737">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="899109369">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{17, 282}, {113, 22}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <int key="NSTag">1</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="356138985">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">67108864</int>
+ <string key="NSContents">Phone numbers:</string>
+ <object class="NSFont" key="NSSupport" id="395180031">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="899109369"/>
+ <int key="NSButtonFlags">-2046410497</int>
+ <int key="NSButtonFlags2">134</int>
+ <reference key="NSAlternateImage" ref="395180031"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="616693835">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{138, 282}, {322, 22}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="666629112">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="395180031"/>
+ <reference key="NSControlView" ref="616693835"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="611647702">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="1001404264">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSButton" id="503420049">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{17, 315}, {113, 25}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="941815424">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">67108864</int>
+ <string key="NSContents">Name:</string>
+ <reference key="NSSupport" ref="395180031"/>
+ <reference key="NSControlView" ref="503420049"/>
+ <int key="NSButtonFlags">-2046410497</int>
+ <int key="NSButtonFlags2">134</int>
+ <reference key="NSAlternateImage" ref="395180031"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="804867281">
+ <reference key="NSNextResponder" ref="439893737"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{138, 318}, {322, 22}}</string>
+ <reference key="NSSuperview" ref="439893737"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="487203716">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="395180031"/>
+ <reference key="NSControlView" ref="804867281"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <reference key="NSBackgroundColor" ref="611647702"/>
+ <reference key="NSTextColor" ref="1001404264"/>
+ </object>
+ </object>
+ </object>
<string key="NSFrameSize">{480, 360}</string>
<reference key="NSSuperview"/>
</object>
@@ -1088,6 +1188,54 @@
</object>
<int key="connectionID">374</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showPluginMenu:</string>
+ <reference key="source" ref="273591641"/>
+ <reference key="destination" ref="503420049"/>
+ </object>
+ <int key="connectionID">390</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showPluginMenu:</string>
+ <reference key="source" ref="273591641"/>
+ <reference key="destination" ref="899109369"/>
+ </object>
+ <int key="connectionID">391</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: me.phone</string>
+ <reference key="source" ref="616693835"/>
+ <reference key="destination" ref="273591641"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="616693835"/>
+ <reference key="NSDestination" ref="273591641"/>
+ <string key="NSLabel">value: me.phone</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">me.phone</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">398</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: me.name</string>
+ <reference key="source" ref="804867281"/>
+ <reference key="destination" ref="273591641"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="804867281"/>
+ <reference key="NSDestination" ref="273591641"/>
+ <string key="NSLabel">value: me.name</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">me.name</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">399</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -1701,6 +1849,13 @@
<object class="IBObjectRecord">
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="899109369"/>
+ <reference ref="616693835"/>
+ <reference ref="503420049"/>
+ <reference ref="804867281"/>
+ </object>
<reference key="parent" ref="972006081"/>
</object>
<object class="IBObjectRecord">
@@ -1708,6 +1863,62 @@
<reference key="object" ref="273591641"/>
<reference key="parent" ref="1049"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">378</int>
+ <reference key="object" ref="804867281"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="487203716"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">379</int>
+ <reference key="object" ref="487203716"/>
+ <reference key="parent" ref="804867281"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">382</int>
+ <reference key="object" ref="616693835"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="666629112"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">383</int>
+ <reference key="object" ref="666629112"/>
+ <reference key="parent" ref="616693835"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">386</int>
+ <reference key="object" ref="899109369"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="356138985"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">387</int>
+ <reference key="object" ref="356138985"/>
+ <reference key="parent" ref="899109369"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">388</int>
+ <reference key="object" ref="503420049"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="941815424"/>
+ </object>
+ <reference key="parent" ref="439893737"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">389</int>
+ <reference key="object" ref="941815424"/>
+ <reference key="parent" ref="503420049"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -1859,6 +2070,14 @@
<string>371.lastResizeAction</string>
<string>372.IBPluginDependency</string>
<string>375.IBPluginDependency</string>
+ <string>378.IBPluginDependency</string>
+ <string>379.IBPluginDependency</string>
+ <string>382.IBPluginDependency</string>
+ <string>383.IBPluginDependency</string>
+ <string>386.IBPluginDependency</string>
+ <string>387.IBPluginDependency</string>
+ <string>388.IBPluginDependency</string>
+ <string>389.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.ImportedFromIB2</string>
<string>56.IBPluginDependency</string>
@@ -2054,6 +2273,14 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@@ -2109,12 +2336,24 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">375</int>
+ <int key="maxID">399</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
+ <string key="className">ExampleController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showPluginMenu:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">ExampleController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
View
BIN ExampleApplication/English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown.
View
11 ExampleApplication/Example.py
@@ -0,0 +1,11 @@
+def actionProperty():
+ return "label-click"
+
+def actionEnable():
+ return True
+
+def actionTitle():
+ return "Python example"
+
+def actionPerform():
+ print "Hello from Python"
View
15 ExampleApplication/Example.rb
@@ -0,0 +1,15 @@
+def applicationProperty
+ return "label-click"
+end
+
+def applicationEnable withValue, forValue
+ return true
+end
+
+def applicationTitle withValue, forValue
+ return "Ruby example"
+end
+
+def applicationPerform withValue, forValue
+ puts "In Ruby example"
+end
View
17 ExampleApplication/ExampleApplication.sdef
@@ -399,32 +399,35 @@ SUCH DAMAGE.
</suite>
<suite name="ExampleApplication suite" code="exPM" description="Skeleton suite for implementing Applescript plugins">
<cocoa name="ExampleApplication"/>
- <command name="action property" code="exPMAprp">
+ <class name="application" code="capp" inherits="application">
+ <cocoa class="NSApplication"/>
+ </class>
+ <command name="action property" code="exPMXprp">
<result type="text"/>
</command>
- <command name="action enable" code="exPMAena">
+ <command name="action enable" code="exPMXena">
<parameter name="for" code="foR_" type="any">
<cocoa key="for"/>
</parameter>
- <parameter name="with" code="wiTh" type="any">
+ <parameter name="with" code="wITh" type="any">
<cocoa key="with"/>
</parameter>
<result type="boolean"/>
</command>
- <command name="action title" code="exPMAtit">
+ <command name="action title" code="exPMXtit">
<parameter name="for" code="foR_" type="any">
<cocoa key="for"/>
</parameter>
- <parameter name="with" code="wiTh" type="any">
+ <parameter name="with" code="wITh" type="any">
<cocoa key="with"/>
</parameter>
<result type="text"/>
</command>
- <command name="action perform" code="exPMaPer">
+ <command name="action perform" code="exPMXprf">
<parameter name="for" code="foR_" type="any">
<cocoa key="for"/>
</parameter>
- <parameter name="with" code="wiTh" type="any">
+ <parameter name="with" code="wITh" type="any">
<cocoa key="with"/>
</parameter>
<result type="any"/>
View
56 ExampleApplication/ExampleApplication.xcodeproj/ghansard.mode1v3
@@ -250,6 +250,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -288,24 +290,24 @@
<string>29B97314FDCFA39411CA2CEA</string>
<string>1DC323CE0F3B77B40011E197</string>
<string>1DC3242A0F3B86790011E197</string>
- <string>080E96DDFE201D6D7F000001</string>
- <string>29B97317FDCFA39411CA2CEA</string>
- <string>1DC323CF0F3B77BE0011E197</string>
+ <string>29B97323FDCFA39411CA2CEA</string>
<string>19C28FACFE9D520D11CA2CBB</string>
<string>1C37FBAC04509CD000000102</string>
+ <string>1DD73A340F3C9F0400552B38</string>
+ <string>1DD73B300F3CA0EC00552B38</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>10</integer>
- <integer>9</integer>
- <integer>1</integer>
- <integer>0</integer>
+ <integer>34</integer>
+ <integer>33</integer>
+ <integer>28</integer>
+ <integer>27</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 73}, {186, 338}}</string>
+ <string>{{0, 308}, {186, 338}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -369,8 +371,6 @@
<string>0pt</string>
</dict>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -407,9 +407,9 @@
</array>
<key>TableOfContents</key>
<array>
- <string>1D973DF60F3BE5AF00437B6D</string>
+ <string>1DD73A4E0F3C9F0C00552B38</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>1D973DF70F3BE5AF00437B6D</string>
+ <string>1DD73A4F0F3C9F0C00552B38</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -528,7 +528,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>255583660.67448199</real>
+ <real>255631596.62058601</real>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
@@ -543,7 +543,9 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>1DC323630F3B75AF0011E197</string>
<string>1CD10A99069EF8BA00B06720</string>
+ <string>1C78EAAD065D492600B07095</string>
<string>/Users/ghansard/Projects/github/PluginManager/ExampleApplication/ExampleApplication.xcodeproj</string>
</array>
<key>WindowString</key>
@@ -626,7 +628,7 @@
<key>TableOfContents</key>
<array>
<string>1DC323630F3B75AF0011E197</string>
- <string>1DC323640F3B75AF0011E197</string>
+ <string>1DD73A580F3C9F3000552B38</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
@@ -668,8 +670,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {316, 194}}</string>
- <string>{{316, 0}, {378, 194}}</string>
+ <string>{{0, 0}, {316, 198}}</string>
+ <string>{{316, 0}, {378, 198}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
@@ -684,8 +686,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {694, 194}}</string>
- <string>{{0, 194}, {694, 187}}</string>
+ <string>{{0, 0}, {694, 198}}</string>
+ <string>{{0, 198}, {694, 183}}</string>
</array>
</dict>
</dict>
@@ -718,7 +720,7 @@
<real>148</real>
</array>
<key>Frame</key>
- <string>{{316, 0}, {378, 194}}</string>
+ <string>{{316, 0}, {378, 198}}</string>
<key>RubberWindowFrame</key>
<string>373 433 694 422 0 0 1440 878 </string>
</dict>
@@ -746,13 +748,13 @@
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>1D973DF80F3BE5AF00437B6D</string>
+ <string>1DD73A500F3C9F0C00552B38</string>
<string>1C162984064C10D400B95A72</string>
- <string>1D973DF90F3BE5AF00437B6D</string>
- <string>1D973DFA0F3BE5AF00437B6D</string>
- <string>1D973DFB0F3BE5AF00437B6D</string>
- <string>1D973DFC0F3BE5AF00437B6D</string>
- <string>1D973DFD0F3BE5AF00437B6D</string>
+ <string>1DD73A510F3C9F0C00552B38</string>
+ <string>1DD73A520F3C9F0C00552B38</string>
+ <string>1DD73A530F3C9F0C00552B38</string>
+ <string>1DD73A540F3C9F0C00552B38</string>
+ <string>1DD73A550F3C9F0C00552B38</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
@@ -916,7 +918,7 @@
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>1DC323FC0F3B79D10011E197</string>
+ <string>1DD73AC40F3C9FA500552B38</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
@@ -926,7 +928,7 @@
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>Identifier</key>
View
9 ExampleApplication/ExampleApplication.xcodeproj/ghansard.pbxuser
@@ -38,6 +38,11 @@
1DC323C70F3B77990011E197 /* ExampleObjCPlugin */ = {
activeExec = 0;
};
+ 1DC324310F3B89D30011E197 /* ExampleApplication.sdef */ = {
+ uiCtxt = {
+ sepNavWindowFrame = "{{15, 9}, {795, 864}}";
+ };
+ };
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeArchitecture = i386;
activeBuildConfigurationName = Debug;
@@ -109,8 +114,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 255583660;
- PBXWorkspaceStateSaveDate = 255583660;
+ PBXPerProjectTemplateStateSaveDate = 255631107;
+ PBXWorkspaceStateSaveDate = 255631107;
};
sourceControlManager = 1DC322F40F3B747D0011E197 /* Source Control */;
userBuildSettings = {
View
24 ExampleApplication/ExampleApplication.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
+ 1D973ECE0F3BE83900437B6D /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D973ECD0F3BE83900437B6D /* AddressBook.framework */; };
+ 1D973F320F3BF36000437B6D /* Example.py in Resources */ = {isa = PBXBuildFile; fileRef = 1D973F310F3BF36000437B6D /* Example.py */; };
1DC3230B0F3B74FA0011E197 /* ApplescriptPluginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */; };
1DC3230C0F3B74FA0011E197 /* FScriptPlugInManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC322FA0F3B74FA0011E197 /* FScriptPlugInManager.m */; };
1DC3230D0F3B74FA0011E197 /* JavascriptPluginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC322FC0F3B74FA0011E197 /* JavascriptPluginManager.m */; };
@@ -32,6 +34,9 @@
1DC323EC0F3B795E0011E197 /* ExampleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DC323EB0F3B795E0011E197 /* ExampleController.m */; };
1DC3242E0F3B87190011E197 /* Example.scpt in Copy plugins */ = {isa = PBXBuildFile; fileRef = 1DC3242B0F3B870C0011E197 /* Example.scpt */; };
1DC324320F3B89D30011E197 /* ExampleApplication.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 1DC324310F3B89D30011E197 /* ExampleApplication.sdef */; };
+ 1DD73AC20F3C9F9B00552B38 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DD73AC10F3C9F9B00552B38 /* ScriptingBridge.framework */; };
+ 1DD73B280F3CA06500552B38 /* Example.rb in Resources */ = {isa = PBXBuildFile; fileRef = 1DD73B270F3CA06500552B38 /* Example.rb */; };
+ 1DD73B2E0F3CA0DE00552B38 /* Example.rb in Copy plugins */ = {isa = PBXBuildFile; fileRef = 1DD73B270F3CA06500552B38 /* Example.rb */; };
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 = (); }; };
@@ -55,6 +60,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
+ 1DD73B2E0F3CA0DE00552B38 /* Example.rb in Copy plugins */,
1DC3242E0F3B87190011E197 /* Example.scpt in Copy plugins */,
1DC323DC0F3B78C90011E197 /* ExampleObjCPlugin.bundle in Copy plugins */,
);
@@ -67,6 +73,8 @@
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 1D973ECD0F3BE83900437B6D /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = /System/Library/Frameworks/AddressBook.framework; sourceTree = "<absolute>"; };
+ 1D973F310F3BF36000437B6D /* Example.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = Example.py; sourceTree = "<group>"; };
1DC322F70F3B74FA0011E197 /* ApplescriptPluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplescriptPluginManager.h; sourceTree = "<group>"; };
1DC322F80F3B74FA0011E197 /* ApplescriptPluginManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplescriptPluginManager.m; sourceTree = "<group>"; };
1DC322F90F3B74FA0011E197 /* FScriptPlugInManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FScriptPlugInManager.h; sourceTree = "<group>"; };
@@ -105,6 +113,8 @@
1DC323EB0F3B795E0011E197 /* ExampleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleController.m; sourceTree = "<group>"; };
1DC3242B0F3B870C0011E197 /* Example.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.scpt; path = Example.scpt; sourceTree = "<group>"; };
1DC324310F3B89D30011E197 /* ExampleApplication.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = ExampleApplication.sdef; sourceTree = "<group>"; };
+ 1DD73AC10F3C9F9B00552B38 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = "<absolute>"; };
+ 1DD73B270F3CA06500552B38 /* Example.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = Example.rb; 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>"; };
@@ -136,6 +146,8 @@
1DC3235D0F3B75370011E197 /* libruby.dylib in Frameworks */,
1DC323660F3B75C70011E197 /* LuaCore.framework in Frameworks */,
1DC323BE0F3B76C40011E197 /* Carbon.framework in Frameworks */,
+ 1D973ECE0F3BE83900437B6D /* AddressBook.framework in Frameworks */,
+ 1DD73AC20F3C9F9B00552B38 /* ScriptingBridge.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -178,7 +190,7 @@
name = Products;
sourceTree = "<group>";
};
- 1DC322F60F3B74FA0011E197 /* src */ = {
+ 1DC322F60F3B74FA0011E197 /* PluginManager */ = {
isa = PBXGroup;
children = (
1DC3235F0F3B75910011E197 /* NSApplescript+FCSAdditions.h */,
@@ -204,7 +216,7 @@
1DC323090F3B74FA0011E197 /* RubyPluginManager.h */,
1DC3230A0F3B74FA0011E197 /* RubyPluginManager.m */,
);
- name = src;
+ name = PluginManager;
path = ../src;
sourceTree = SOURCE_ROOT;
};
@@ -212,7 +224,7 @@
isa = PBXGroup;
children = (
1DC3242A0F3B86790011E197 /* PlugIns */,
- 1DC322F60F3B74FA0011E197 /* src */,
+ 1DC322F60F3B74FA0011E197 /* PluginManager */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -234,6 +246,8 @@
isa = PBXGroup;
children = (
1DC3242B0F3B870C0011E197 /* Example.scpt */,
+ 1D973F310F3BF36000437B6D /* Example.py */,
+ 1DD73B270F3CA06500552B38 /* Example.rb */,
);
name = PlugIns;
sourceTree = "<group>";
@@ -272,6 +286,8 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 1DD73AC10F3C9F9B00552B38 /* ScriptingBridge.framework */,
+ 1D973ECD0F3BE83900437B6D /* AddressBook.framework */,
1DC323BD0F3B76C40011E197 /* Carbon.framework */,
1DC3235C0F3B75370011E197 /* libruby.dylib */,
1DC323650F3B75C70011E197 /* LuaCore.framework */,
@@ -359,6 +375,8 @@
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DC324320F3B89D30011E197 /* ExampleApplication.sdef in Resources */,
+ 1D973F320F3BF36000437B6D /* Example.py in Resources */,
+ 1DD73B280F3CA06500552B38 /* Example.rb in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
7 ExampleApplication/ExampleController.h
@@ -7,10 +7,15 @@
//
#import <Cocoa/Cocoa.h>
+#import <AddressBook/AddressBook.h>
@interface ExampleController : NSObject {
-
+ NSDictionary *_me;
}
+@property (retain) NSDictionary *me;
+
+- (IBAction)showPluginMenu:(id)sender;
+
@end
View
34 ExampleApplication/ExampleController.m
@@ -11,11 +11,39 @@
@implementation ExampleController
+@synthesize me = _me;
+
- (void)awakeFromNib
{
- NSLog(@"%s", _cmd);
- NSArray *plugins = [PluginManager pluginsForProperty:@"label-click" forValue:nil withValue:nil];
- NSLog(@"%s %@", _cmd, plugins);
+ ABAddressBook *book = [ABAddressBook sharedAddressBook];
+ ABPerson *me = [book me];
+ NSDictionary *meDict = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSString stringWithFormat:@"%@ %@", [me valueForProperty:kABFirstNameProperty], [me valueForProperty:kABLastNameProperty], nil], @"name",
+ [me valueForProperty:kABPhoneProperty], @"phone", nil];
+ self.me = meDict;
+}
+
+- (IBAction)showPluginMenu:(id)sender {
+ id value = nil;
+ if ([sender tag] == 0) value = [self.me objectForKey:@"name"];
+ else if ([sender tag] == 1) value = [self.me objectForKey:@"phone"];
+ NSArray *plugins = [PluginManager pluginsForProperty:@"label-click" forValue:self.me withValue:value];
+
+ NSMenu *m = [[[NSMenu alloc] initWithTitle:@"pluginMenu"] autorelease];
+ for (NSDictionary *plugin in plugins) {
+ NSDictionary *pluginDict = [NSDictionary dictionaryWithObjectsAndKeys:
+ plugin, @"plugin",
+ value, @"value", nil];
+ NSMenuItem *mi = [m addItemWithTitle:[plugin objectForKey:@"title"] action:@selector(performPlugin:) keyEquivalent:@""];
+ [mi setRepresentedObject:pluginDict];
+ [mi setTarget:self];
+ }
+ [NSMenu popUpContextMenu:m withEvent:[NSApp currentEvent] forView:sender];
+}
+
+- (IBAction)performPlugin:(id)sender {
+ NSDictionary *pluginDict = [sender representedObject];
+ [PluginManager runPlugin:[pluginDict objectForKey:@"plugin"] forValue:self.me withValue:[pluginDict objectForKey:@"value"]];
}
@end
View
2 ExampleApplication/Info.plist
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
- <string>????</string>
+ <string>exPM</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSAppleScriptEnabled</key>
View
38 src/ApplescriptPluginManager.m
@@ -33,32 +33,24 @@ -(void)build
if (_plugins) [_plugins release];
_plugins = [NSMutableDictionary new];
- NSString *pluginsPath = [PluginManager pathToPluginsFolder];
- NSFileManager *fm = [NSFileManager defaultManager];
- BOOL isFolder;
- if (![fm fileExistsAtPath:pluginsPath isDirectory:&isFolder] || !isFolder) return;
-
- NSEnumerator *e = [[fm directoryContentsAtPath:pluginsPath] objectEnumerator];
- NSString *path = nil;
+ NSArray *foundPlugins = [PluginManager pluginFilesForSubmanager:self];
NSAppleEventDescriptor *procDesc = [NSAppleScript processDescriptor];
- while (path = [e nextObject])
+ for (NSString *path in foundPlugins)
{
- if ([[path pathExtension] isEqualToString:@"scpt"])
+ NSAppleScript *as = [NSAppleScript appleScriptWithContentsOfFile:path];
+ if (!as) continue;
+ NSAppleEventDescriptor *desc = [NSAppleEventDescriptor appleEventWithEventClass:ASPluginAppClassCode eventID:ASPluginPropertyEventCode targetDescriptor:procDesc returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
+ id err = nil;
+ NSAppleEventDescriptor *ret = [as executeAppleEvent:desc error:&err];
+ NSLog(@"%s %@", _cmd, err);
+ NSLog(@"%s %@", _cmd, ret);
+ if (ret)
{
- NSAppleScript *as = [NSAppleScript appleScriptWithContentsOfFile:[pluginsPath stringByAppendingPathComponent:path]];
- if (as)
- {
- NSAppleEventDescriptor *desc = [NSAppleEventDescriptor appleEventWithEventClass:ASPluginAppClassCode eventID:ASPluginPropertyEventCode targetDescriptor:procDesc returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
- NSAppleEventDescriptor *ret = [as executeAppleEvent:desc error:nil];
- if (ret)
- {
- NSString *property = [ret stringValue];
- NSMutableArray *arr = [_plugins objectForKey:property];
- if (!arr) arr = [NSMutableArray array];
- [arr addObject:as];
- [_plugins setObject:arr forKey:property];
- }
- }
+ NSString *property = [ret stringValue];
+ NSMutableArray *arr = [_plugins objectForKey:property];
+ if (!arr) arr = [NSMutableArray array];
+ [arr addObject:as];
+ [_plugins setObject:arr forKey:property];
}
}
}
View
2 src/PluginManagerApplescriptIncludes.h
@@ -1,5 +1,5 @@
enum PluginAppleEventCodes {
- ASPluginAppClassCode = 'pClp',
+ ASPluginAppClassCode = 'exPM',
ASPluginForCode = 'foR_',
ASPluginWithCode = 'wITh',
View
22 src/PythonPluginManager.m
@@ -107,7 +107,7 @@ id depythonify(PyObject *value) {
func = (pyobjcobject_new_t)dlsym(RTLD_DEFAULT, "PyObjCObject_New");
if (!func) {
NSLog(@"Could not find PyObjCObject_New. Error: %s", dlerror());
- return nil;
+ return Py_None;
}
return func(value, 0, NO);
}
@@ -161,23 +161,9 @@ - (void)build
{
if (_plugins) [_plugins release];
_plugins = [NSMutableDictionary new];
- NSString *pluginsPath = [PluginManager pathToPluginsFolder];
- NSFileManager *fm = [NSFileManager defaultManager];
- BOOL isFolder;
- if (![fm fileExistsAtPath:pluginsPath isDirectory:&isFolder] || !isFolder) return;
-
- NSArray *plugins = [fm directoryContentsAtPath:pluginsPath];
- plugins = [plugins arrayByAddingObjectsFromArray:[fm directoryContentsAtPath:[[NSBundle mainBundle] pathForResource:@"Plugins" ofType:nil]]];
- NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
- NSString *path;
- NSArray *extensions = [self extensions];
- while (path = [pluginEnumerator nextObject])
- {
- if (![extensions containsObject:[path pathExtension]]) continue;
-
+ for (NSString *path in [PluginManager pluginFilesForSubmanager:self]) {
Py_SetProgramName("/usr/bin/python");
- NSString *fullPath = [pluginsPath stringByAppendingPathComponent:path];
- FILE *pyFile = fopen([fullPath fileSystemRepresentation], "r");
+ FILE *pyFile = fopen([path fileSystemRepresentation], "r");
// The main module (__main__ in Python) pretty much represents the Python script. When it is loaded,
// the main module will contain references to the functions that will be called.
@@ -185,7 +171,7 @@ - (void)build
PyObject *globals = PyModule_GetDict(mainModule);
// Load the Python file using PyRun_File and then call the actionProperty() function
- PyRun_File(pyFile, [fullPath UTF8String], Py_file_input, globals, globals);
+ PyRun_File(pyFile, [path UTF8String], Py_file_input, globals, globals);
NSString *property = [self callFunction:@"actionProperty" ofModule:mainModule arguments:nil];
NSMutableArray *arr = [_plugins objectForKey:property];

0 comments on commit 3d73036

Please sign in to comment.
Something went wrong with that request. Please try again.