Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 11, 2016, 02:07:24 AM
  • Proudly celebrating 10 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: Using alias action keywords  (Read 1019 times)

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 231
    • View Profile
    • Donate to Member
Using alias action keywords
« on: August 18, 2015, 03:12:15 AM »
I am wondering is it possible to use alias action modifier keywords but to use the selected file's directory as an argument for the action, istead of the full filename?

I have an alias setup to search my projects folder, only for sln files. This is my use case:

Input:
cc demo

Result:
C:\projects\MyProject\MyProjectDemo.sln
C:\projects\Other\DemoOther.sln
...


Now, I want to be able to append +cmd to the search string and basically the results don't change, but if I press enter on one of the results, I would get a command prompt open in the folder containing the selected sln file.
It is impossible to make anything foolproof because fools are so ingenious.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 231
    • View Profile
    • Donate to Member
Re: Using alias action keywords
« Reply #1 on: August 18, 2015, 03:15:30 AM »
Also, there is an option to "show action modifier label on 1 result".
Is it possible to show action modifier label on all results?
It is impossible to make anything foolproof because fools are so ingenious.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
Re: Using alias action keywords
« Reply #2 on: August 25, 2015, 04:18:49 PM »
I am wondering is it possible to use alias action modifier keywords but to use the selected file's directory as an argument for the action, istead of the full filename?
Not sure, maybe there's no built in way to do that. How about this autohotkey workaround? Save as test.ahk and compile:
file = %1%
ifnotexist, %file%
 exitapp
SplitPath, file,, dir
if GetKeyState("Shift")
 Run, cmd.exe , %dir%
else
 Run, %1%

Then change the alias to run test.exe with the whole filepath as alias. If you hold down shift while pressing enter on a result for that alias in FARR the script should open a command window in the files folder, if not then it will execute the file. Note: I haven't tested it, but I think it'll work.