DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Using alias action keywords  (Read 5,141 times)

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
Using alias action keywords
« on: August 18, 2015, 08:12 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:

Code
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: 267
Re: Using alias action keywords
« Reply #1 on: August 18, 2015, 08:15 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: 1,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Using alias action keywords
« Reply #2 on: August 25, 2015, 09:18 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:
Code
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.

Original address: https://www.donationcoder.com/forum/index.php?topic=41447.0