topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday October 6, 2024, 12:25 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Sending the selected text to a program via FARR  (Read 3698 times)

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Sending the selected text to a program via FARR
« on: March 07, 2020, 06:18 PM »
I have https://velocity.silverlakesoftware.com/ (documentation for programming languages) installed and am wondering if it is possible to select some text, press a key, send it to FARR and then click a mini toolbar icon or type "v e l o.." to have this string be passed onto Velocity and show the results.
<a href="https://sridharkatakam.com">My blog</a>

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #1 on: March 07, 2020, 06:29 PM »
Interesting question.

I'll add a new field (%search%) that you can specify in toolbar launch parameters to pass the search text.

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #2 on: March 07, 2020, 07:10 PM »
In Mac I am addicted to LaunchBar's Instant Send feature.

I wrote about it in my Facebook group which am quoting below:

LB's IS is like the 1-way API that connects any program on the computer to another or user-defined webservice by relaying data (text or file(s) or folder(s)).

Example 1:

Let's say I see the text "vertical carousel" on a webpage and I want to look it up in the WordPress plugin repo, the normal way is to copy the string, open up the WP plugin repo site, paste and search for it. With IS, this is the workflow:

1. Highlight the string you want to act on
2. Press Alt (a user-defined modifier key) to bring up LB (a floating palette with a search box) with the string populated
3. Type or just begin to type "wps" and hit return
4. The webpage opens in the default browser

where I've already set up a custom web search called "WordPress Plugins Search" with something like this as the URL: https://wordpress.org/plugins/search/*/ (* will be replaced with the search term).

LB is smart enough to fuzzy match "wps" with the name of my custom search, "WordPress Plugins Search" and pass the string onto the designated search URL.

Example 2:

I see a file in Finder or Path Explorer and I want to upload it to Droplr. Yes, it is possible to drag and drop it into the Droplor icon. But it is quicker and easier to press Alt, begin typing "drop..", see Droplor appear in the suggestions list because it is already installed in the computer, hit return and the file gets uploaded with the URL ready to be pasted.

Example 3:

I am writing some code in the code editor and find a function that I'd like to more about. Select the string, press Alt, begin typing 'dash' and hit return when Dash is shortlisted and I instantly see the results in Dash (a programming languages lookup tool).

So basically everything and anything you do online and on the computer can be done with 2 or 3 steps w/o manually setting up custom rules or macros to do.

Example 4:

To save some text to a note-taking app called Bear, I send it to LB by pressing Alt, type "b" and since Bear is the entry most frequently used it appears at the top of the list and hit return to send it to Bear which creates a note in the background w/o me even opening it with the selected text. When I want to look it up, I type "bs" (for Bear Search, a custom search rule), hit return, then type what am looking for and hit return. Most apps for Mac have identifiers allowing for entries inside to be searchable from other apps just like how we can search websites.
<a href="https://sridharkatakam.com">My blog</a>

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #3 on: March 07, 2020, 07:35 PM »
You can easily set up a custom hotkey for FARR that will copy the text you have selected in any program, and then bring up farr with a menu of choices that you can select from (and filter by typing).
I use this feature to do exactly the kind of thing you are talking about.
Here's a recent example of how to do this to translate words: https://www.donation...ic=49637.0;topicseen
But you can use this to bring up a custom alias result with multiple entries for each kind of thing you might want to do with the selected text.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #4 on: March 08, 2020, 04:56 AM »
Adding one tip on top of what mouser said and linked to:
You can also make a hotkey that copies selected text to clipboard but leaves the FARR search box empy on open.
Next you create an alias for Velocity (and one for any other tool you want to pass a selected string to).

In other words, instead of tying one hotkey to a single program, or to a single alias that lists a number of programs, you make a generic "copy selection and open FARR" hotkey and then set up any number of aliases that you want to use with it.

1.png


2.png

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #5 on: March 08, 2020, 10:26 AM »
Adding a tip to what Nod5 says :)

To see what you are going to launch you can change that result from
Selection to Velocity | C:\folder path\velocityprogram.exe "$$c"

To:
Velocity $$c | C:\folder path\velocityprogram.exe "$$c"

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #6 on: March 08, 2020, 05:34 PM »
I think I got the FARR part configured ok, but have a suspicion that Velocity is not taking in what is sent to it from FARR because when I run the alias with some text selected and then select the 3rd option in the results list, nothing happens. Velocity does not open or get switched to.

https://i.imgur.com/IyEuxj4.png

https://i.imgur.com/GJukB7t.png
<a href="https://sridharkatakam.com">My blog</a>

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Sending the selected text to a program via FARR
« Reply #7 on: March 08, 2020, 07:30 PM »
try using $$c instead of %cliptext%