topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday April 16, 2024, 5:33 am
  • 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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - dreftymac [ switch to compact view ]

Pages: [1]
1
Find And Run Robot / alias pastefromfile instead of alias paste
« on: May 07, 2021, 04:36 PM »
Greetings!

## Question

Is there an alias that works just like paste %WHATEVER% ... except it takes the contents of %WHATEVER% from a filepath on your local machine?

Something like pastefromfile %FILEPATH_HERE% ?

Something like pastefromfile c:\docs\temp\mytemporary_text_file.txt ?

## Rationale

The rationale for this request: paste works great for single-line-only text, but this request is looking for something that can take any arbitrary multi-line-string that lives in a file somewhere on the local machine.

2
Greetings Fellow FARR fans!

When the user presses the FARR hotkey(s) for an already-running instance of FARR, is there a way for an *external* script or application to tell whether FARR still has focus?

The reason for this question is I'd like to see if FARR can work as a kind of "command console" for already-running instances of other windows apps.

If this could work, a user could FARR not only to *launch* other applications, but actually *interact* with them as well. The "other" application could trigger the FARR hotkey, the user could input some commands, and the "other" application could wait for FARR to be dismissed and then try to act on whatever the user did inside FARR.

An alternative of course is to just send commands from FARR to other applications, using plugins, but it'd be nice to go the other way as well, and just use FARR as a "plugin" of sorts inside another application that does all the work. FARR could then just act as a "smart command window".

If you have heard of "Quicksilver" for the Mac or "Ubiquity" for Firefox, you understand the basic concept I am shooting for.

There is a pretty easy way (by using other software along with FARR) to detect when the FARR window is active and when it has focus, and when it loses focus, but I am just curious if anyone has ever tried this just by using FARR itself.

Any feedback or reference to other existing forum topics on this issue much appreciated.

3
BACKGROUND:
Find+Run Robot
v2.30.01 by DonationCoder
working with custom-made fscript javascript plugin

QUESTION:
How can you apply the tab-autocomplete feature to fscript-generated
FARR results?

DETAILS:
I am custom generating a list of output results from a javascript plugin
using the really great plugin system. I would like to be able to autocomplete
and let the user press tab to make the completed suggestion appear in the
launcher input box. The steps below describe what I am trying to do.

STEPS:
- user enters the alias to trigger the plugin

    fooscript       <-- FARR user input box
   
- the fooscript plugin returns a long list of results
- the user types some text to narrow down the results

    fooscript base  <-- FARR user input box
   
- the result list now shows only those entries that have:

    1) the word "base" in the launch list; or
    2) the word "base" in the path string down in the FARR statusbar
    (both of these are generated by the fscript)
   
    For example:
   
    fooscript base  <-- FARR user input box
   
    play.baseball   <-- result list
    clean.basement
    base64.encode
    base64.decode
    insert.basename

- NEEDED: what i would like to do is allow the user to arrow down
    to one of the items in the filtered result list, and then press
    TAB. In the previous example, the user presses arrow down
    three times and then TAB to get this:
   
    fooscript base64.encode  <-- FARR user input box
   
RATIONALE:
The reason why I would like to do this is because the user
should be allowed to enter additional arguments before triggering
the command:
   
    fooscript base64.encode "hello world" <-- FARR user input box
   
    *The user would now press ENTER and the fscript will take the
     result and run the appropriate action*
   
ALTERNATIVE:
I notice that you can always right-click an item in the result
list and choose "copy path" ... the problem with this is it copies
the status bar text at the bottom, and I would like it to copy the
text from the result list instead. This way the user could copy
and just paste into the FARR user input box.

Does anyone know how to get autocomplete working this way?

TIA

4
Greetings Fellow-FARR-Fans,

After learning about the command-line arguments that you can send to FARR, I tried to use the -show option. It works, but it does not seem to work as advertised in the help document. Specifically, the part about "(or bring up any running copy) " doesn't seem to actually bring up an existing instance of FARR.

To prove this I created a script that just calls FARR after one instance is already running and showing in the taskbar. Sure enough, when running the script there is a slight delay and then FARR runs a second instance, which clearly shows up in the taskbar along with the previous instance.

### QUESTION 1:
Is there something I'm doing wrong, or a special way to formulate the commandline string so that FARR will simply instantiate the already-running instance?

### QUESTION 2:
If -show is truly capable of running an existing instance of FARR, is it also possible to use -show in combination with -search so that the already-running instance of FARR can be instantiated, and pre-populated with a filled-in search (such as an alias string)? I tried both and niether option seems to honor the (any running copy) clause.

Thanks in advance for any additional insight.



5
BACKGROUND:

    FARR: v2.10.01 by DonationCoder
    SCRIPT: fscript.js plugin script using the javascript plugin facility
    RUN PROFILE: calling farr.exe with the argument      -show -search ":myplugin";

SCENARIO:

I run farr using the prefix defined by my plugin as a commandline argument. All my plugin does is generate a list of suggestions
using FARR.emitResult. Then the user gets to pick one of the suggestions from the list. Once the user has chosen, the plugin
simply pastes what the user chose using the FARR "paste" command. This is done in the onProcessTrigger function of the jscript
file.

            FARR.setStrValue("launch", "paste "+path);           
            return CLOSE;

This works fine when the user types something that is already inside the suggestion list. If the user types something that is not
yet in the list, however, the script has to handle the input using onRegexSearchMatch function.

PROBLEM:
I am having trouble figuring out how to treat user input the same way inside the onRegexSearchMatch function. All I want to do
is take what the user typed and then paste it with the paste command. I have gotten this to work halfway, but FARR refuses to
dismiss when the user presses ENTER. It just sits there. Also, when FARR is started up again the next time, the input box is frozen
and wont accept keystrokes. The only way I have figured out how to dismiss FARR is to use FARR.debug(), which seems to make
FARR go away.

    function onRegexSearchMatch(querykey,querynokeyword) {
        var curr_match  =   null;
        curr_match      =   querynokeyword.match(scriptregex);
        if(curr_match[curr_match.length-1].toString() != ''){
            var stemp       =   '';
            stemp           =   curr_match[curr_match.length-1].toString().strip();

            // The paste works, but i dont want to have to use FARR.debug just to get the FARR window to close
            // Also, when FARR is started up again the next time, the input box is frozen and wont accept
            // keystrokes.
            FARR.setStrValue("launch", "paste "+stemp+"\n");                       
            FARR.debug('');
        }
    }



QUESTION:
What is the correct way to handle the scenario described here?

This is a step by step description of what I am trying to do.

1) Startup FARR so the prefix for my plugin is automatically filled into the search bar (doing that now with a script that calls FARR with command line args)
2) Allow the user to type in a string to be handled by my plugin
3) Generate a list of "suggestions" to the user, automatically generated by the plugin script
3) a) if the user input matches one of the auto-generated suggestions, take that input and just use FARR paste to get it into the last running app
3) b) if the user input does not match any of the auto-generated suggestions, match that input anyway and paste it into the last running app
4) keep track of whatever input the user supplied in either 3a) or 3b) and save it to a special history file
5) dismiss FARR window and make it wait in the background as usual

I can get all of the above steps to work as expected *except* for step 3) b) and step 5). When those two things happen together I cannot get FARR to exit normally nor startup and accept user input normally.

If you can help out, please do. Thanks.

6
Hello FARR-folks!

I am impressed with FARR and I'd like a little help to
determine if FARR is the right tool for me.

I would like to be able to do a proof of concept script
using the Javascript API. I've read the documentation and
I am pretty certain this is possible, I just have not found
it yet.

=====================
Code: Text [Select]
  1. STEP1:
  2. Output the following strings to FARR results pane:
  3.  
  4. * Hello World!
  5. * Bonjour Tout le Monde!
  6. * Hola Mundo!
  7. * Guten Tag Welt!
  8.  
  9. STEP2:
  10. Allow the user to choose one item from the results pane.
  11. (e.g., user presses ENTER on Hola Mundo!)
  12.  
  13. STEP3:
  14. Take the text that the user selected and paste it into the
  15. previously-active window.
=====================

STEP3 is the one I need help with, the other steps are pretty
easy to figure out from the existing examples.

Also, I'd like to see an example of step3 where FARR launches
any arbitrary application and passes in whatever the user
chose as a cmdline argument to that application.

Any help you can provide will be appreciated, as it will be
a big step in deciding whether FARR is the right tool for
me and I can jump in here with a donation and some code to
possibly help others.

Thanks in advance,

Pages: [1]