avatar image

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

Login with username, password and session length
  • Sunday June 16, 2024, 1:31 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

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.

Messages - Xavi_8m [ switch to compact view ]

Pages: [1]
Find And Run Robot / Re: Use of Variables inside Aliases
« on: April 27, 2019, 07:36 AM »
Excellent! Thanks a lot for the support.

The suggested use of a Filtered Alias list is indeed the better option: more dynamic and easier to maintain than a list of variables. Still I wish I could use variables inside aliases!


Find And Run Robot / Re: Use of Variables inside Aliases
« on: April 26, 2019, 04:52 PM »
Could you tell more about the use case?

Surely. What I am after is a simple UserName <--> UserID mapping when querying a URL.

Allow me to illustrate it with a practical example. Say, for example, that I own a webpage and every new user gets a numeric ID. After four new users have registered you end up with a UserName <--> UserID map like this one:

Alice is User 001
Bob is user 002
Carl is user 003
Daniel is user 004

Now, say that this webpage of mine allows you to access the user profile pages through an URL such as:

Where USERID is the number assigned to each user. So, if you wanted to access Daniel's profile you'd visit the following URL:

But in your day-to-day life you ain't gonna remember that Daniel is user "004", you will remember Daniel as Daniel!!! So what I want to do is to create a macro of sorts that takes in the real name of the user:

mykeyword Daniel

and then maps the user's name to the respective user ID, and builds the URL:

That's where my original post comes in. My idea around this issue would be to create a set of variables such as:


... and then I'd use a regular expression to capture the first parameter, which would then be fed to the following alias:$$1%

That'd be it!
To be completely honest I haven't given too much thought to the issue. Maybe the optimal solution doesn't use Aliases, or maybe I am overthinking the problem a little too hard. It just felt natural to me using a regular expression as a variable name (that is, abusing/assuming reflection). So I tried... and failed  :-[

Find And Run Robot / Use of Variables inside Aliases
« on: April 26, 2019, 06:39 AM »
Hello there, new user here!

I've gotta say that I am having an absolute blast fiddling around with Find And Run Robot. I adore how amazingly powerful it can be with a footprint of 3MBytes. I'm also digging big time that it's not "indexed", minimizing the footprint even further. I'm most definitely gonna start using it as my main launcher, waving goodbye to heavier alternatives.

Now I'll cut to the chase: I'm having an issue while attempting to use variables inside Aliases, and I was hoping someone could lend me a hand.

First of all, I'll say that I have a programming background, and I've read the Alias and Variables Help pages thoroughly, so I am aware of how variables are to be used (at least at a basic level). For example, I know that if a variable is defined as:


Then, said variable can be accessed via %uservar.myvar.hundred% from inside the Alias. I've created a test alias to illustrate how this would work. Here's the test configuration:

Fig1. Setup of an Alias that uses a raw variable

And here's how the test triggers the variable:

Fig2. Using the previous Alias. Please, note that the "hundred" string is actually
not necessary, it could've been any other string (or even empty)

So far so good. No issues here. My problem comes when I want to use a regular expression captured group to access a variable name. Here's where things get dirty:

Fig3. Setup of an Alias that uses a regex capture group as a variable

And here's where the problem that appears:the Alias does not seem to resolve the variable name (uservar.myvar.$$1) properly. When I try to use the alias from the launcher I get this error message of sorts:

Fig4. Using the regex'd Alias

My question being.... why is this not working!?!?!?!?!?

I am pretty sure that I know what the problem is in here: most likely, the Alias parser is looking for actual variable uservar.myvar.$$1, with the dollar symbols and all, which of course does not exist. But then comes the UI print function, which does indeed resolve the $$1 into "hundred" and thus spits the error message we see in Figure 4:


I'm gonna guess that I'm asking too deep of a question, but I'll cross my fingers and hope for an available quick fix for this issue. Maybe using 3 dollar symbols instead of 2? Putting it upside down and shaking it?  ;D

Thank you very much for such an amazing piece of software, and I'll see you around,

Pages: [1]