Current Selection in Trigger

30 views
Skip to first unread message

Quicksilver

unread,
Nov 11, 2021, 7:50:17 AM11/11/21
to Quicksilver
Hello, how to use Current Selection object in Triggers?
For example to open currently selected file with an application.
Or maybe another solution with Services, Shortcuts?

2.png

Rob McBroom

unread,
Nov 11, 2021, 8:24:26 AM11/11/21
to Quicksilver
On 10 Nov 2021, at 7:59, Quicksilver wrote:

> Hello, how to use Current Selection object in Triggers?

It should be as simple as searching for Current Selection in the first pane of the Trigger builder in Preferences.

> For example to open currently selected file with an application.

That depends may or may not work. When you ask for the Current Selection, Quicksilver will first check to see if a plug-in provides special behavior for the current application. For example, Quicksilver’s Finder plug-in includes custom AppleScript to return the selected file(s). The iTunes plug-in (when it worked) could return the selected track or playlist.

If that fails, it will do the equivalent of copying the selection with ⌘C. That works in some Cocoa applications without special code. For example, in TextMate you can select text in the editor or a file in the file browser and get the expected thing from Current Selection. This is unlikely to work in an Electron app.

--
Rob McBroom

Rob McBroom

unread,
Nov 12, 2021, 6:49:51 AM11/12/21
to Quicksilver, Quicksilver
On 12 Nov 2021, at 3:56, Quicksilver wrote:

>>
>> It should be as simple as searching for Current Selection in the first
>> pane of the Trigger builder in Preferences.
>>
>
> how to do that exactly?

When you create a new trigger, the interface to build it will pop up. It’s just like searching in the main Quicksilver interface. Type “CS” or whatever you would normally do to find Current Selection.

--
Rob McBroom
Reply all
Reply to author
Forward
0 new messages