Execute commands consistently #699

Merged
merged 6 commits into from Feb 23, 2012

Projects

None yet

2 participants

@skurfer
Quicksilver OS X member

This contains fixes for #623 and #670.

Long story short, you couldn’t have a trigger for something like “Finder Selection → Compress”. Now you can.

The problem was that there were different places that could execute an action and they didn’t all behave the same way. Rather than duplicate code, I’ve attempted to move things around so the same code is used no matter how an action is run.

I initially didn’t like QSommand doing so much with the interface controller, but I’ve talked myself into it. I can go into more detail if anyone is similarly uneasy.

I’ve tried executing things every way I can think of (using the interface, triggers, droplets, encapsulated commands, commands saved to disk, commands run after delay) and they all seem to function correctly.

skurfer added some commits Jan 31, 2012
@skurfer skurfer group similar functionality together so it can be modified more easily
`executePartialCommand:` and `performOnDirectObject:indirectObject:` were each being called in two different places
b4fea8d
@skurfer skurfer add a missing method declaration cd0e212
@skurfer skurfer handle actions that return results when commands are executed
Previously, these actions would only work correctly if run by the user from the interface. Now they should work in other contexts.

fixes #623
8e6113a
@skurfer skurfer remove objects selected by the comma trick for triggers that ask for …
…input - fixes #670
f2d98df
@skurfer skurfer quiet an NSLog() when not debugging ce3fe60
@pjrobertson pjrobertson referenced this pull request Feb 18, 2012
Closed

iTunes Module Crash #702

@pjrobertson
Quicksilver OS X member

Funny I should only stumble upon this now after years of QS use, just as you've open this...

Seems like #670 also applies to objects grabbed with ⌘⎋. Would it be possible to fix that? Should be pretty easy I imagine. The ⌘⎋ command runs the receiveObject method in QSController.m. I came across it when fixing the getSelectionJump pull #643

@skurfer
Quicksilver OS X member

Seems like #670 also applies to objects grabbed with ⌘⎋. Would it be possible to fix that?

Same goes for things opened with the qs command-line tool. I’ll see if I can fix them both.

@skurfer skurfer referenced this pull request in quicksilver/CommandLineTool-qsplugin Feb 20, 2012
Merged

General updates #2

@skurfer
Quicksilver OS X member

I’ll see if I can fix them both.

Done. :-)

@pjrobertson
Quicksilver OS X member

Oooh the command line tool. Never actually used that. Any good?

This all looks good. i'll keep playing

@skurfer
Quicksilver OS X member

Oooh the command line tool. Never actually used that. Any good?

Yeah, I forget it’s there most of the time, but I’ve rediscovered it in the past couple of weeks. It’s pretty cool. One time I love having it is when I’m in a plug-in’s directory doing git stuff and I want to open the Xcode project. There are lots of ways to do it, but the fastest I’ve found is to just run qs ., then hit / to go into the folder, at which point it’s pretty easy to find the project file.

@pjrobertson

You can put this line and the next into one, to save doing the test twice, but some thing it's more difficult to read:

if ([actionObject isKindOfClass:[QSRankedObject class]] && QSAction * rankedAction = [(QSRankedObject *)actionObject object]) {

You might have to declare rankedAction before though. I really don't think this would affect the performance of QS though!

@pjrobertson
Quicksilver OS X member

I see the problem with the current command line tool. I'm assuming your change over there fixes it.

Other than that, everything looks good.

P.S. I use a different method to you for getting e.g. the current folder/file/whatever in terminal/whatever.
With the User Interface Access module install, I have a trigger for Current DocumentSelect in Command Window.

I think this is probably my most used thing in Quicksilver since neurolepsy introduced it a year or so ago. You can use it on practically anything: Safari URLs, Terminal Windows, non-cocoa apps (MS Word etc.), Preview...

@pjrobertson pjrobertson merged commit e6ae4d6 into quicksilver:master Feb 23, 2012
@skurfer
Quicksilver OS X member

I see the problem with the current command line tool. I'm assuming your change over there fixes it.

Yep.

You can use it on practically anything: Safari URLs, Terminal Windows, non-cocoa apps (MS Word etc.), Preview...

Wow. I knew it was good, but I didn’t know it worked on Terminal’s current directory. I wonder if it’s only because we have it in the title bar? Anyway, cool.

BTW, my favorite new trigger (now that this is merged): Finder Selection → Get Path (scoped to Finder only)

@pjrobertson
Quicksilver OS X member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment