Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1048 from pjrobertson/AppleScript

AppleScript action improvements. Fixes #1023
  • Loading branch information...
commit f5da5b836e25e576a0d23933f16d8837657c38d6 2 parents f882ccd + 2461394
@skurfer skurfer authored
View
2  Quicksilver/Code-QuickStepFoundation/NSAppleScript_BLTRExtensions.m
@@ -197,7 +197,7 @@ + (NSAppleEventDescriptor *)descriptorWithPath:(NSString *)path {
@implementation NSAppleScript (FilePeeking)
+ (NSArray *)validHandlersFromArray:(NSArray *)array inScriptFile:(NSString *)path {
- NSData *scriptData = [NSData dataWithContentsOfMappedFile:path];
+ NSData *scriptData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:path] options:NSDataReadingMappedAlways error:nil];
if (![scriptData length]) {
NDResourceFork *resource = [NDResourceFork resourceForkForReadingAtPath:path];
scriptData = [resource dataForType:'scpt' Id:128];
View
3  Quicksilver/Code-QuickStepInterface/QSResizingInterfaceController.m
@@ -45,8 +45,7 @@ - (void)adjustWindow:(id)sender {
} else {
NSResponder *firstResponder = [[self window] firstResponder];
if (firstResponder == iSelector
- || firstResponder == [iSelector currentEditor]
- || ([iSelector objectValue] != nil && ![[iSelector objectValue] objectForType:QSTextProxyType]) ) {
+ || firstResponder == [iSelector currentEditor]) {
[self expandWindow:sender];
return;
}
View
16 Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSAppleScriptActions.h
@@ -13,14 +13,28 @@
# define kAppleScriptOpenFilesAction @"AppleScriptOpenFilesAction"
# define kAppleScriptRunAction @"AppleScriptRunAction"
+// Used as a prefix to the identifier for all AppleScript action objects. Distinguishes them from plain old files
+# define kAppleScriptActionIDPrefix @"[Action]:"
+
+
# define kAppleScriptRunTextAction @"AppleScriptRunTextAction"
#define kQSScriptSuite 'DAED'
+// opnt = OPeN Text
#define kQSOpenTextScriptCommand 'opnt'
+// opfl = OPen FiLe
+#define kQSOpenFileScriptCommand 'opfl'
+// garc = Get ARgument Count
#define kQSGetArgumentCountCommand 'garc'
-#define kQSOpenTextIndirectParameter 'IdOb'
+// giob = Get Indirect OBject
+#define kQSGetIndirectObjectTypesCommand 'giob'
+// gdob = Get Direct OBject
+#define kQSGetDirectObjectTypesCommand 'gdob'
+// IdOb = Indirect Object
+#define kQSIndirectParameter 'IdOb'
@interface QSAppleScriptActions : QSActionProvider
- (QSObject*)runAppleScript:(NSString *)scriptPath withArguments:(QSObject *)iObject;
+-(NSAppleEventDescriptor *)eventDescriptorForObject:(QSObject *)iObject;
@end
View
197 Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSAppleScriptActions.m
@@ -23,7 +23,7 @@
@implementation QSAppleScriptActions
- (QSAction *)scriptActionForPath:(NSString *)path {
- NSArray *handlers = [NSAppleScript validHandlersFromArray:[NSArray arrayWithObjects:@"aevtoapp", @"DAEDopnt", @"aevtodoc", nil] inScriptFile:path];
+ NSArray *handlers = [NSAppleScript validHandlersFromArray:[NSArray arrayWithObjects:@"aevtoapp", @"DAEDopnt", @"aevtodoc",@"DAEDopfl", nil] inScriptFile:path];
NSMutableDictionary *actionDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
NSStringFromClass([self class]), kActionClass,
@@ -32,17 +32,48 @@ - (QSAction *)scriptActionForPath:(NSString *)path {
[NSNumber numberWithBool:YES], kActionDisplaysResult,
nil];
- if ([handlers containsObject:@"DAEDopnt"]) {
- [actionDict setObject:[NSArray arrayWithObject:QSTextType] forKey:kActionDirectTypes];
- [actionDict setObject:@"QSOpenTextEventPlaceholder" forKey:kActionHandler];
- [actionDict setObject:[NSArray arrayWithObject:QSTextType] forKey:kActionIndirectTypes];
+ // try to get the valid direct/indirect types from the AppleScript's 'get direct/indirect types' handler to set on the actionDict
+ NSArray *validDirectTypes = [self validDirectTypesForScript:path];
+ NSArray *validIndirectTypes = [self validIndrectTypesForScript:path];
+
+ // get the argument count of the script. 1 = dObj only. 2 = dObj + iObj. 3 = indirect Optional
+ NSInteger argumentCount = [self argumentCountForScript:path];
+
+ if ([handlers containsObject:@"aevtodoc"] || [handlers containsObject:@"DAEDopfl"]) {
+ // Only set the type if the user hasn't specified any (i.e. hasn't set the 'get direct types' handler)
+ if (!validDirectTypes) {
+ validDirectTypes = [NSArray arrayWithObject:QSFilePathType];
+ }
+ [actionDict setObject:[handlers containsObject:@"DAEDopfl"] ? @"QSOpenFileWithEventPlaceholder" : @"QSOpenFileEventPlaceholder" forKey:kActionHandler];
+ if (!validIndirectTypes) {
+ validIndirectTypes = [NSArray arrayWithObject:QSFilePathType];
+ }
}
- if ([handlers containsObject:@"aevtodoc"]) {
- [actionDict setObject:[NSArray arrayWithObject:QSFilePathType] forKey:kActionDirectTypes];
- [actionDict setObject:@"QSOpenFileEventPlaceholder" forKey:kActionHandler];
+ if ([handlers containsObject:@"DAEDopnt"] && ![handlers containsObject:@"DAEDopfl"]) {
+ // Only set the type if the user hasn't specified any (i.e. hasn't set the 'get direct types' handler)
+ if (!validDirectTypes) {
+ validDirectTypes = [NSArray arrayWithObject:QSTextType];
+ }
+ [actionDict setObject:@"QSOpenTextEventPlaceholder" forKey:kActionHandler];
+ if (!validIndirectTypes) {
+ validIndirectTypes = [NSArray arrayWithObject:QSTextType];
+ }
}
+ if ([validDirectTypes count]) {
+ [actionDict setObject:validDirectTypes forKey:kActionDirectTypes];
+ }
+ if ([validIndirectTypes count]) {
+ [actionDict setObject:validIndirectTypes forKey:kActionIndirectTypes];
+ }
+ if (argumentCount == 3) {
+ // argumentCount == 3 means indirect optional
+ [actionDict setObject:[NSNumber numberWithBool:YES] forKey:kActionIndirectOptional];
+ argumentCount = 2;
+ }
+ [actionDict setObject:[NSNumber numberWithInteger:argumentCount] forKey:kActionArgumentCount];
+
NSString *actionName = [[path lastPathComponent] stringByDeletingPathExtension];
- QSAction *action = [QSAction actionWithDictionary:actionDict identifier:[@"[Action]:" stringByAppendingString:path]];
+ QSAction *action = [QSAction actionWithDictionary:actionDict identifier:[kAppleScriptActionIDPrefix stringByAppendingString:path]];
[action setName:actionName];
[action setObject:path forMeta:kQSObjectIconName];
return action;
@@ -140,7 +171,7 @@ - (QSObject*)runAppleScript:(NSString *)scriptPath withArguments:(QSObject *)iOb
} else {
event = [[NSAppleEventDescriptor alloc] initWithEventClass:kQSScriptSuite eventID:kQSOpenTextScriptCommand targetDescriptor:targetAddress returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
[event setParamDescriptor:[NSAppleEventDescriptor descriptorWithString:[iObject stringValue]] forKeyword:keyDirectObject];
- [event setDescriptor:[NSAppleEventDescriptor descriptorWithString:@""] forKeyword:kQSOpenTextIndirectParameter];
+ [event setDescriptor:[NSAppleEventDescriptor descriptorWithString:@""] forKeyword:kQSIndirectParameter];
}
[targetAddress release];
returnDesc = [script executeAppleEvent:event error:&errorInfo];
@@ -166,6 +197,17 @@ - (QSObject *)objectForDescriptor:(NSAppleEventDescriptor *)desc {
return nil;
}
+-(NSAppleEventDescriptor *)eventDescriptorForObject:(QSObject *)object {
+ NSArray *paths = [object validPaths];
+ NSAppleEventDescriptor *objectDescriptor = nil;
+ if ([paths count] > 0) {
+ objectDescriptor = [NSAppleEventDescriptor aliasListDescriptorWithArray:paths];
+ } else {
+ objectDescriptor = [NSAppleEventDescriptor descriptorWithString:[object stringValue]];
+ }
+ return objectDescriptor;
+}
+
- (QSObject *)performAction:(QSAction *)action directObject:(QSObject *)dObject indirectObject:(QSObject *)iObject {
NSDictionary *dict = [action objectForType:QSActionType];
NSString *scriptPath = [dict objectForKey:kActionScript];
@@ -186,10 +228,19 @@ - (QSObject *)performAction:(QSAction *)action directObject:(QSObject *)dObject
NSDictionary *errorDict = nil;
NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:scriptPath] error:&errorDict];
- if ([handler isEqualToString:@"QSOpenFileEventPlaceholder"]) {
+ if ([handler isEqualToString:@"QSOpenFileEventPlaceholder"] || [handler isEqualToString:@"QSOpenFileWithEventPlaceholder"]) {
+ event = [[NSAppleEventDescriptor alloc] initWithEventClass:[handler isEqualToString:@"QSOpenFileEventPlaceholder"] ? kCoreEventClass :kQSScriptSuite
+ eventID:[handler isEqualToString:@"QSOpenFileEventPlaceholder"] ? kAEOpenDocuments : kQSOpenFileScriptCommand
+ targetDescriptor:targetAddress
+ returnID:kAutoGenerateReturnID
+ transactionID:kAnyTransactionID];
NSArray *files = [dObject validPaths];
- event = [[NSAppleEventDescriptor alloc] initWithEventClass:kCoreEventClass eventID:kAEOpenDocuments targetDescriptor:targetAddress returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
[event setParamDescriptor:[NSAppleEventDescriptor aliasListDescriptorWithArray:files] forKeyword:keyDirectObject];
+ if(iObject && ![[iObject primaryType] isEqualToString:QSTextProxyType]) {
+ NSAppleEventDescriptor *iObjectDescriptor = [self eventDescriptorForObject:iObject];
+ [event setDescriptor:iObjectDescriptor forKeyword:kQSIndirectParameter];
+ }
+
} else if ([handler isEqualToString:@"QSOpenTextEventPlaceholder"]) {
event = [[NSAppleEventDescriptor alloc] initWithEventClass:kQSScriptSuite
eventID:kQSOpenTextScriptCommand
@@ -197,20 +248,8 @@ - (QSObject *)performAction:(QSAction *)action directObject:(QSObject *)dObject
returnID:kAutoGenerateReturnID
transactionID:kAnyTransactionID];
[event setParamDescriptor:[NSAppleEventDescriptor descriptorWithString:[dObject stringValue]] forKeyword:keyDirectObject];
- NSArray *indirectPaths = [iObject validPaths];
- NSAppleEventDescriptor *iObjectDescriptor = nil;
- NSUInteger indirectPathCount = [indirectPaths count];
- if (indirectPathCount == 1) {
- iObjectDescriptor = [NSAppleEventDescriptor descriptorWithString:[indirectPaths objectAtIndex:0]];
- } else if (indirectPathCount > 1) {
- iObjectDescriptor = [NSAppleEventDescriptor listDescriptor];
- for (NSString *path in indirectPaths) {
- [iObjectDescriptor insertDescriptor:[NSAppleEventDescriptor descriptorWithString:path] atIndex:0];
- }
- } else {
- iObjectDescriptor = [NSAppleEventDescriptor descriptorWithString:[iObject stringValue]];
- }
- [event setDescriptor:iObjectDescriptor forKeyword:kQSOpenTextIndirectParameter];
+ NSAppleEventDescriptor *iObjectDescriptor = [self eventDescriptorForObject:iObject];
+ [event setDescriptor:iObjectDescriptor forKeyword:kQSIndirectParameter];
} else {
id object;
NSArray *types = [action directTypes];
@@ -247,27 +286,77 @@ - (NSArray *)validActionsForDirectObject:(QSObject *)dObject indirectObject:(QSO
return nil;
}
+
+-(NSArray *)validDirectTypesForScript:(NSString *)path {
+ return [self typeArrayForScript:path forHandler:@"DAEDgdob"];
+}
+
+-(NSArray *)validIndrectTypesForScript:(NSString *)path {
+ return [self typeArrayForScript:path forHandler:@"DAEDgiob"];
+}
+
- (NSArray *)validIndirectObjectsForAction:(NSString *)action directObject:(QSObject *)dObject {
- return ([action isEqualToString:kAppleScriptOpenTextAction] ? [NSArray arrayWithObject:[QSObject textProxyObjectWithDefaultValue:@""]] : nil);
+ if ([action isEqualToString:kAppleScriptOpenTextAction]) {
+ return [NSArray arrayWithObject:[QSObject textProxyObjectWithDefaultValue:@""]];
+ } else if ([action isEqualToString:kAppleScriptOpenFilesAction]) {
+ return [QSLib arrayForType:QSFilePathType];
+ };
+ if ([action rangeOfString:kAppleScriptActionIDPrefix].location != NSNotFound) {
+ // Applescript action, so attempt to get the valid types from the file itself ('get indirect types' handler)
+ return [self validIndirectObjectsForAppleScript:action directObject:dObject];
+ }
+ return nil;
}
-- (NSInteger)argumentCountForAction:(NSString *)actionId {
- NSInteger argumentCount = 1;
+-(NSArray *)validIndirectObjectsForAppleScript:(NSString *)script directObject:(QSObject *)dObject {
+ NSString *scriptPath = [self scriptPathForID:script];
+
+ id indirectTypes = [self validIndrectTypesForScript:scriptPath];
+ if (indirectTypes) {
+ NSMutableArray *indirectObjects = [NSMutableArray array];
+ for (NSString *type in indirectTypes) {
+ [indirectObjects addObjectsFromArray:[QSLib arrayForType:type]];
+ }
+ return [[indirectObjects copy] autorelease];
+ }
+ return nil;
+}
+
+-(NSString *)scriptPathForID:(NSString *)actionId {
QSAction *action = [QSAction actionWithIdentifier:actionId];
NSString *scriptPath = [action objectForKey:kActionScript];
+
+ if (!scriptPath) {
+ return nil;
+ }
- if ([actionId isEqualToString:kAppleScriptOpenTextAction] || [actionId isEqualToString:kAppleScriptOpenFilesAction])
- argumentCount = 2;
+ if ([scriptPath hasPrefix:@"/"] || [scriptPath hasPrefix:@"~"]) {
+ scriptPath = [scriptPath stringByStandardizingPath];
+ } else {
+ scriptPath = [[action bundle] pathForResource:[scriptPath stringByDeletingPathExtension] ofType:[scriptPath pathExtension]];
+ }
+ return scriptPath;
+}
+
+- (NSInteger)argumentCountForAction:(NSString *)actionId {
- // TODO: figure out why all this code is here - scriptPath always seems to be nil
+ if ([actionId isEqualToString:kAppleScriptOpenTextAction] || [actionId isEqualToString:kAppleScriptOpenFilesAction]) {
+ return 2;
+ }
+
+ NSString *scriptPath = [self scriptPathForID:actionId];
+ if (!scriptPath) {
+ // can't find the script so just return 1 and hope for the best
+ return 1;
+ }
+
+ // this should never realistically be called, since the script argument count is set in scriptActionForPath: (above)
+ return [self argumentCountForScript:scriptPath] > 1 ? 2 : 1;
+}
- if (!scriptPath)
- return argumentCount;
- if ([scriptPath hasPrefix:@"/"] || [scriptPath hasPrefix:@"~"])
- scriptPath = [scriptPath stringByStandardizingPath];
- else
- scriptPath = [[action bundle] pathForResource:[scriptPath stringByDeletingPathExtension] ofType:[scriptPath pathExtension]];
+-(NSInteger)argumentCountForScript:(NSString *)scriptPath {
+ NSInteger argumentCount = 1;
NSArray *handlers = [NSAppleScript validHandlersFromArray:[NSArray arrayWithObject:@"DAEDgarc"] inScriptFile:scriptPath];
if( handlers != nil && [handlers count] != 0 ) {
@@ -291,11 +380,35 @@ - (NSInteger)argumentCountForAction:(NSString *)actionId {
[script release];
}
-
-#ifdef DEBUG
- NSLog(@"argument count for %@ is %ld", actionId, (long)argumentCount);
-#endif
return argumentCount;
}
+
+// Retrieves an array of types from either the 'get direct types' or 'get indirect types' AppleScript handlers (depending on the input parameter 'handler')
+-(NSArray *)typeArrayForScript:(NSString *)scriptPath forHandler:(NSString *)handler {
+ id types = nil;
+ NSArray *handlers = [NSAppleScript validHandlersFromArray:[NSArray arrayWithObject:handler] inScriptFile:scriptPath];
+ if( handlers != nil && [handlers count] != 0 ) {
+ NSAppleEventDescriptor *event;
+ int pid = [[NSProcessInfo processInfo] processIdentifier];
+ NSAppleEventDescriptor* targetAddress = [[NSAppleEventDescriptor alloc] initWithDescriptorType:typeKernelProcessID bytes:&pid length:sizeof(pid)];
+
+ NSDictionary *errorDict = nil;
+ NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:scriptPath] error:&errorDict];
+
+ event = [[NSAppleEventDescriptor alloc] initWithEventClass:kQSScriptSuite eventID:[handler isEqualToString:@"DAEDgdob"] ? kQSGetDirectObjectTypesCommand : kQSGetIndirectObjectTypesCommand targetDescriptor:targetAddress returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
+
+ NSAppleEventDescriptor *result = [script executeAppleEvent:event error:&errorDict];
+ if( result ) {
+ // Convert the AS list type to an array
+ types = (NSArray *)[result arrayValue];
+ } else if( errorDict != nil )
+ NSLog(@"error %@", errorDict);
+ [event release];
+ [targetAddress release];
+ [script release];
+ }
+ return types;
+}
+
@end
View
16 Quicksilver/Scripting/Quicksilver.sdef
@@ -75,15 +75,29 @@
</suite>
<suite name="Script Handlers" code="DAEH" description="Handlers for Actions and other scripts.">
<cocoa name="QuicksilverHandlers"/>
+ <command name="open files" code="DAEDopfl" description="Open file(s) from Quicksilver">
+ <cocoa class="NSScriptCommand" />
+ <direct-parameter description="File to open" type="any" />
+ <parameter name="with" code="IdOb" description="indirect object" type="any" optional="yes" />
+ <result description="value to return to Quicksilver" type="any" />
+ </command>
<command name="process text" code="DAEDopnt" description="Process some text. Scripts with this handler gain a &apos;Process Text&apos; action">
<cocoa class="NSScriptCommand"/>
<direct-parameter description="text to process" type="text"/>
<parameter name="with" code="IdOb" description="indirect object" type="any" optional="yes"/>
<result description="value to return to Quicksilver" type="any"/>
</command>
- <command name="get argument count" code="DAEDgarc" description="Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are 1, 2.">
+ <command name="get argument count" code="DAEDgarc" description="Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are: 1 = 1st pane only; 2 = 1st pane and 3rd pane; 3 = 1st pane, and 3rd pane (optional).">
<cocoa class="NSScriptCommand"/>
<result description="value to return to Quicksilver" type="integer"/>
</command>
+ <command name="get indirect types" code="DAEDgiob" description="Get the valid indirect (3rd pane) object types for this action. Scripts with this handler can customize the types of objects displayed in Quicksilver's 3rd pane by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types">
+ <cocoa class="NSScriptCommand"/>
+ <result description="value to return to Quicksilver" type="list"/>
+ </command>
+ <command name="get direct types" code="DAEDgdob" description="Get the valid direct (1st pane) object types for which this action will appear. Scripts with this handler can customize for which types of objects the action appears for, by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types">
+ <cocoa class="NSScriptCommand"/>
+ <result description="value to return to Quicksilver" type="list"/>
+ </command>
</suite>
</dictionary>
View
56 Quicksilver/Scripting/QuicksilverHandlers.scriptSuite
@@ -19,6 +19,62 @@
<key>Type</key>
<string>NSNumber&lt;Int&gt;</string>
</dict>
+ <key>GetDirectTypes</key>
+ <dict>
+ <key>AppleEventClassCode</key>
+ <string>DAED</string>
+ <key>AppleEventCode</key>
+ <string>gdob</string>
+ <key>CommandClass</key>
+ <string>NSScriptCommand</string>
+ <key>ResultAppleEventCode</key>
+ <string>****</string>
+ <key>Type</key>
+ <string>list</string>
+ </dict>
+ <key>GetIndirectTypes</key>
+ <dict>
+ <key>AppleEventClassCode</key>
+ <string>DAED</string>
+ <key>AppleEventCode</key>
+ <string>giob</string>
+ <key>CommandClass</key>
+ <string>NSScriptCommand</string>
+ <key>ResultAppleEventCode</key>
+ <string>****</string>
+ <key>Type</key>
+ <string>list</string>
+ </dict>
+ <key>OpenFiles</key>
+ <dict>
+ <key>AppleEventClassCode</key>
+ <string>DAED</string>
+ <key>AppleEventCode</key>
+ <string>opfl</string>
+ <key>Arguments</key>
+ <dict>
+ <key>with</key>
+ <dict>
+ <key>AppleEventCode</key>
+ <string>IdOb</string>
+ <key>Optional</key>
+ <string>YES</string>
+ <key>Type</key>
+ <string>NSObject</string>
+ </dict>
+ </dict>
+ <key>CommandClass</key>
+ <string>NSScriptCommand</string>
+ <key>ResultAppleEventCode</key>
+ <string>****</string>
+ <key>Type</key>
+ <string>NSObject</string>
+ <key>UnnamedArgument</key>
+ <dict>
+ <key>Type</key>
+ <string>NSObject</string>
+ </dict>
+ </dict>
<key>ProcessText</key>
<dict>
<key>AppleEventClassCode</key>
View
38 Quicksilver/Scripting/QuicksilverHandlers.scriptTerminology
@@ -7,10 +7,46 @@
<key>GetArgumentCount</key>
<dict>
<key>Description</key>
- <string>Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are 1, 2.</string>
+ <string>Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are: 1 = 1st pane only; 2 = 1st pane and 3rd pane; 3 = 1st pane, and 3rd pane (optional).</string>
<key>Name</key>
<string>get argument count</string>
</dict>
+ <key>GetDirectTypes</key>
+ <dict>
+ <key>Description</key>
+ <string>Get the valid direct (1st pane) object types for which this action will appear. Scripts with this handler can customize for which types of objects the action appears for, by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types</string>
+ <key>Name</key>
+ <string>get direct types</string>
+ </dict>
+ <key>GetIndirectTypes</key>
+ <dict>
+ <key>Description</key>
+ <string>Get the valid indirect (3rd pane) object types for this action. Scripts with this handler can customize the types of objects displayed in Quicksilver's 3rd pane by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types</string>
+ <key>Name</key>
+ <string>get indirect types</string>
+ </dict>
+ <key>OpenFiles</key>
+ <dict>
+ <key>Arguments</key>
+ <dict>
+ <key>with</key>
+ <dict>
+ <key>Description</key>
+ <string>indirect object</string>
+ <key>Name</key>
+ <string>with</string>
+ </dict>
+ </dict>
+ <key>Description</key>
+ <string>Open file(s) from Quicksilver</string>
+ <key>Name</key>
+ <string>open files</string>
+ <key>UnnamedArgument</key>
+ <dict>
+ <key>Description</key>
+ <string>File to open</string>
+ </dict>
+ </dict>
<key>ProcessText</key>
<dict>
<key>Arguments</key>
View
41 Quicksilver/Scripting/QuicksilverScripting.r
@@ -472,6 +472,23 @@ resource 'aete' (0, "Quicksilver") {
{
/* Events */
+ "open files",
+ "Open file(s) from Quicksilver",
+ 'DAED', 'opfl',
+ '****',
+ "value to return to Quicksilver",
+ replyRequired, singleItem, notEnumerated, Reserved13,
+ '****',
+ "File to open",
+ directParamRequired,
+ singleItem, notEnumerated, Reserved13,
+ {
+ "with", 'IdOb', '****',
+ "indirect object",
+ optional,
+ singleItem, notEnumerated, Reserved13
+ },
+
"process text",
"Process some text. Scripts with this handler gain a 'Process Text' action",
'DAED', 'opnt',
@@ -490,7 +507,7 @@ resource 'aete' (0, "Quicksilver") {
},
"get argument count",
- "Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are 1, 2.",
+ "Get the argument count for this action. Scripts with this handler can customize their argument count. Valid values are: 1 = 1st pane only; 2 = 1st pane and 3rd pane; 3 = 1st pane, and 3rd pane (optional).",
'DAED', 'garc',
'long',
"value to return to Quicksilver",
@@ -498,6 +515,28 @@ resource 'aete' (0, "Quicksilver") {
dp_none__,
{
+ },
+
+ "get indirect types",
+ "Get the valid indirect (3rd pane) object types for this action. Scripts with this handler can customize the types of objects displayed in Quicksilver's 3rd pane by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types",
+ 'DAED', 'giob',
+ '****',
+ "value to return to Quicksilver",
+ replyRequired, singleItem, notEnumerated, Reserved13,
+ dp_none__,
+ {
+
+ },
+
+ "get direct types",
+ "Get the valid direct (1st pane) object types for which this action will appear. Scripts with this handler can customize for which types of objects the action appears for, by returning a list of types supported. Valid values are shown at http://qsapp.com/wiki/AppleScript_Types",
+ 'DAED', 'gdob',
+ '****',
+ "value to return to Quicksilver",
+ replyRequired, singleItem, notEnumerated, Reserved13,
+ dp_none__,
+ {
+
}
},
{
Please sign in to comment.
Something went wrong with that request. Please try again.