The 'on get argument count' feature does allow for files to be selected in
pane 3. On my setup (ß68 10.7), QS defaults to file input in pane 3. Text
input is possible after pressing period.
Here's a template that works for me:
<code>*using terms from* *application* "Quicksilver"
*on* *process text* _text with iObject
*try*
*if* *class* *of* iObject = *text* *then* *set* iObject *to* {iObject}
*set* _aliasList *to* {}
*repeat* *with* _filepath *in* iObject
*set* _aliasList *to* _aliasList & ((*POSIX file* _filepath) *as* *alias*)
*end* *repeat*
*on* *error* a number b
*set* selection *to* a
*end* *try*
*end* *process text*
*on* *get argument count*
*return* 2
*end* *get argument count*
*end* *using terms from*</code>
For one file, iObject returns a file path text object, e,g.,
"/Users/phil/Desktop". For multiple files, it returns a list, e.g.,
{"/Users/phil/Desktop", "/Users/phil/Downloads"}
The template takes account of this discrepancy and turns the file path list
into an alias list that AppleScript finds easier to use.
Here's an example action I wrote recently:
http://dl.dropbox.com/u/157506/New%20Folder%20with%20Selection.zip
Put it in ~/Library/Application Support/Quicksilver/Actions/ and relaunch
QS.
Enter a new folder name in pane 1, select files in pane 3, and the files
will be duplicated to the new folder in your home folder.
On Saturday, July 21, 2012 5:27:27 AM UTC+9, Daniel wrote:
>
> I know about `on get argument count`, but it can't be combined with `on
> open`. That is, it is possible to write an action that takes text in Pane 1
> and text in Pane 3, but not one that takes (a) file(s) in Pane 1 and text
> in Pane 3 (or a file in Pane 3, for that matter). If anyone knows how, that
> would be great, but I'm 99% sure it's not currently possible.
>
> I posted a massively-overly-long feature request on GitHub a bit ago:
> https://github.com/quicksilver/Quicksilver/issues/947. Looking back on it
> I realize it is, as I say, way too complicated—but the bottom third or so
> re: the AppleScript API would, ultimately, be *really* nice to have.
>
> On Thursday, July 19, 2012 1:22:42 PM UTC-4, Rob McBroom wrote:
>>
>> On Jul 19, 2012, at 11:30 AM, Daniel wrote:
>>
>> > I couldn't write one that asks for the output filename in the 3rd pane,
>> for instance, due to API limitations.
>>
>> I don’t know the details but I think it’s possible. I think you can put a
>> function in the script called “argument_count” that returns 2 and cause the
>> third pane to show up. There are people on this list that know. Hopefully
>> one of them will chime in.
>>
>> --
>> Rob McBroom
>> <http://www.skurfer.com/>
>>
>>
-- You received this message because you are subscribed to the Google Groups
Quicksilver group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send
email to [email protected]. For more options,
visit this group at
https://groups.google.com/d/forum/blacktree-quicksilver?hl=en