topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 4:17 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

Author Topic: Aliases calling aliases  (Read 3381 times)

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Aliases calling aliases
« on: November 22, 2013, 04:50 AM »
I am trying to create an alias that will execute commands in console and display output in FARR.
I am trying to reuse the builtin runcap alias for that.

I have an alias defined like this:
1000>>>Flush DNS>->Flush DNS cache | restartsearch runcap ipconfig /flushdns>+>flush

With this alias I have to press enter twice to actually execute the alias, and the search string changes after the first enter. Also the alias is not working without regex pattern.
I am trying to eliminate the second enter press and the search string change. I tried using dosearch instead of restartsearch but then the alias doesn't trigger (it just changes the search string to the alias name)

Also is it possible to this but to run the alias with admin privileges? When I try /runasadmin switch it just passes it to the runcap alias that in turn passes it to the ipconfig command and that just fails.

Probably I am missing something obvious  :tellme:
It is impossible to make anything foolproof because fools are so ingenious.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Aliases calling aliases
« Reply #1 on: November 22, 2013, 06:19 PM »
I think that frontslash may trip up runcap. The command works if you take the commands from the runcap alias and use them directly in a new alias:
showmemo ;;;appcapappendmemo ipconfig /flushdns

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Aliases calling aliases
« Reply #2 on: November 24, 2013, 05:28 PM »
Does this help, from help file:
restartsearch STRING_TO_SEARCH_FOR - restarts a new search by replacing editbox text (use \s at end of line to add a space after the new search string).  Use \n at the end to simulate the pressing of Enter after the search is conducted (useful especially for plugins triggers).
dosearch STRING TO SEARCH FOR - doesnt change the editbox but causes FARR to display results as if user had typed the string.  very useful in conjunction with regular expression patterns.

It sounds like you want to use restartstearch and combine it with a \n at the end.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Aliases calling aliases
« Reply #3 on: November 25, 2013, 03:15 AM »
Thanks, \n eliminated the second enter which is good enough.
I also wanted to reuse runcap alias, and not copy it (as a dev i like to live by the DRY principle :) )

Is there a way to do restartsearch with /runasadmin switch?

What I want to do is execute a bat script on my machine that requires admin privileges, and also capture the output using runcap alias.
It is impossible to make anything foolproof because fools are so ingenious.