Permalink
Browse files

Automator stuff.

  • Loading branch information...
ccgus committed Mar 6, 2009
1 parent 267c582 commit 5f07b802e636d70ee180058dbe322912d7ec7408
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>AMAccepts</key>
+ <dict>
+ <key>Container</key>
+ <string>List</string>
+ <key>Optional</key>
+ <true/>
+ <key>Types</key>
+ <array>
+ <string>com.apple.cocoa.path</string>
+ <string>com.apple.cocoa.url</string>
+ <string>com.apple.cocoa.string</string>
+ <string>public.item</string>
+ <string>public.image</string>
+ <string>public.text</string>
+ <string>public.url</string>
+ <string>public.data</string>
+ </array>
+ </dict>
+ <key>AMApplication</key>
+ <string>JSTalk Editor</string>
+ <key>AMCanShowSelectedItemsWhenRun</key>
+ <true/>
+ <key>AMCanShowWhenRun</key>
+ <true/>
+ <key>AMCategory</key>
+ <string>AMCategoryUtilities</string>
+ <key>AMDefaultParameters</key>
+ <dict>
+ <key>script</key>
+ <string>function run(input, parameters) {
+
+ /* Your script goes here */
+
+ return input;
+}</string>
+ </dict>
+ <key>AMDescription</key>
+ <dict>
+ <key>AMDAlert</key>
+ <string>(* AMDAlert text goes here. (optional) *)</string>
+ <key>AMDInput</key>
+ <string>(* AMDInput text to further explain the types accepted as input goes here. (optional) *)</string>
+ <key>AMDNote</key>
+ <string>(* AMDNote text goes here. (optional) *)</string>
+ <key>AMDOptions</key>
+ <string>(* AMDOptions text to further explain configuration options in the UI goes here. (optional) *)</string>
+ <key>AMDRelatedActions</key>
+ <string>(* AMDRelatedActions bundle ids go here. (optional) *)</string>
+ <key>AMDRequires</key>
+ <string>(* AMDRequires text to explain anything outside of Automator required for the action&apos;s operation, e.g. a web page open in Safari, goes here. (optional) *)</string>
+ <key>AMDResult</key>
+ <string>(* AMDResult text to further explain the types provided as output goes here. (optional) *)</string>
+ <key>AMDSummary</key>
+ <string>(* AMDSummary text to explain what your action does goes here. *)</string>
+ <key>AMDWebsite</key>
+ <string>(* AMDWebsite URL to additional information or documentation for the action goes here. (optional) *)</string>
+ </dict>
+ <key>AMIconName</key>
+ <string>(* The name of the icon *)</string>
+ <key>AMKeywords</key>
+ <array/>
+ <key>AMName</key>
+ <string>JSTalk</string>
+ <key>AMProvides</key>
+ <dict>
+ <key>Container</key>
+ <string>List</string>
+ <key>Types</key>
+ <array>
+ <string>com.apple.cocoa.path</string>
+ </array>
+ </dict>
+ <key>AMRequiredResources</key>
+ <array/>
+ <key>AMWarning</key>
+ <dict>
+ <key>Action</key>
+ <string>(* Action name to be suggested to add prior to this action to make the task safer, e.g. com.apple.Automator.CopyFiles, goes here. *)</string>
+ <key>ApplyButton</key>
+ <string>(* Button label for user to add proposed Action, e.g. Add. *)</string>
+ <key>IgnoreButton</key>
+ <string>(* Button label for user not to add proposed Action, e.g. Don&apos;t Add. *)</string>
+ <key>Level</key>
+ <integer>0</integer>
+ <key>Message</key>
+ <string>(* Warning message presented to user goes here. *)</string>
+ </dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>1.0, Copyright © 2009 Flying Meat Inc, All Rights Reserved</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.Automator.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2009 Flying Meat Inc, All Rights Reserved.</string>
+ <key>NSPrincipalClass</key>
+ <string>JSTAutomator</string>
+</dict>
+</plist>
View
@@ -0,0 +1,20 @@
+//
+// automator.h
+// automator
+//
+// Created by August Mueller on 3/5/09.
+// Copyright 2009 Flying Meat Inc. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import <Automator/AMBundleAction.h>
+
+@interface JSTAutomator : AMBundleAction {
+ IBOutlet NSTextView *scriptView;
+}
+
+- (void) runScript:(id)sender;
+
+- (id)runWithInput:(id)input fromAction:(AMAction *)anAction error:(NSDictionary **)errorInfo;
+
+@end
View
@@ -0,0 +1,45 @@
+//
+// automator.m
+// automator
+//
+// Created by August Mueller on 3/5/09.
+// Copyright 2009 Flying Meat Inc. All rights reserved.
+//
+
+#import "JSTAutomator.h"
+#import <JSTalk/JSTalk.h>
+
+
+@implementation JSTAutomator
+
+
+- (id)runWithInput:(id)input fromAction:(AMAction *)anAction error:(NSDictionary **)errorInfo {
+ // Add your code here, returning the data to be passed to the next action.
+
+ NSLog(@"input: %@", input);
+ NSLog(@"anAction: %@", anAction);
+
+ id result = 0x00;
+
+ NSString *script = [[self parameters] objectForKey:@"script"];
+
+ if (script) {
+ JSTalk *t = [[[JSTalk alloc] init] autorelease];
+ [t executeString:script];
+ result = [t callFunctionNamed:@"run" withArguments:[NSArray arrayWithObjects:input, nil]];
+ }
+
+
+ return input;
+}
+
+- (void) runScript:(id)sender {
+
+ JSTalk *t = [[[JSTalk alloc] init] autorelease];
+ [t executeString:[[scriptView textStorage] string]];
+ id result = [t callFunctionNamed:@"run" withArguments:[NSArray array]];
+ (void) result;
+
+}
+
+@end
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'automator' target in the 'automator' project.
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
@@ -0,0 +1,76 @@
+// !$*UTF8*$!
+{
+ 089C1669FE841209C02AAC07 = {
+ activeBuildStyle = 014CEA420018CDE011CA2923;
+ activeExecutable = 658A2E03067AB99300421F51;
+ activeTarget = 8D5B49AC048680CD000E48DA;
+ codeSenseManager = 658A2DD0067AB96600421F51;
+ executables = (
+ 658A2E03067AB99300421F51,
+ );
+ sourceControlManager = 658A2DCF067AB96600421F51;
+ userBuildSettings = {
+ };
+ };
+ 658A2DCF067AB96600421F51 = {
+ fallbackIsa = XCSourceControlManager;
+ isa = PBXSourceControlManager;
+ scmConfiguration = {
+ };
+ scmType = "";
+ };
+ 658A2DD0067AB96600421F51 = {
+ indexTemplatePath = "";
+ isa = PBXCodeSenseManager;
+ usesDefaults = 1;
+ wantsCodeCompletion = 1;
+ wantsCodeCompletionAutoPopup = 0;
+ wantsCodeCompletionAutoSuggestions = 1;
+ wantsCodeCompletionCaseSensitivity = 1;
+ wantsCodeCompletionListAlways = 0;
+ wantsCodeCompletionOnlyMatchingItems = 1;
+ wantsCodeCompletionParametersIncluded = 1;
+ wantsCodeCompletionPlaceholdersInserted = 1;
+ wantsCodeCompletionTabCompletes = 1;
+ wantsIndex = 1;
+ };
+ 658A2E03067AB99300421F51 = {
+ activeArgIndex = 0;
+ activeArgIndices = (
+ YES,
+ );
+ argumentStrings = (
+ "-action \"automator.action\"",
+ );
+ configStateDict = {
+ };
+ cppStopOnCatchEnabled = 0;
+ cppStopOnThrowEnabled = 0;
+ customDataFormattersEnabled = 1;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 1;
+ environmentEntries = (
+ );
+ isa = PBXExecutable;
+ launchableReference = 658A2E04067AB99300421F51;
+ libgmallocEnabled = 0;
+ name = Automator;
+ shlibInfoDictList = (
+ );
+ sourceDirectories = (
+ );
+ };
+ 658A2E04067AB99300421F51 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.application;
+ name = Automator.app;
+ path = /Applications/Automator.app;
+ refType = 0;
+ sourceTree = "<absolute>";
+ };
+ 8D5B49AC048680CD000E48DA = {
+ activeExec = 0;
+ };
+}
Oops, something went wrong.

0 comments on commit 5f07b80

Please sign in to comment.