Alias Arguments
-
CookieMonster
Alias Arguments
I know how to create an Alias, what I don't understand is Alias Arguments, why you would use them, it's a little confusing to me. All they seem to do is print a string when I use one of the examples in the documentation, I hope someone can give me more in-depth info I'm not understanding within the documentation.
-
FluxTorpedoe
- Posts: 906
- Joined: 05 Oct 2011 13:15
Re: Alias Arguments
Hi'
Arguments are the element(s) you write after the alias name.
They're useful with scripting where your Alias runs a command and the arguments are the values. e.g.
• Alias Definition:
MyAlias=::command <@1>;
• In Address Bar:
@MyAlias Argument
Well, examples are better than words. (#2 and #3 are very useful!
)
Let's say you've a folder full of files:
Name_01.jpg
Name_02.jpg
...
Name_66.jpg
---------
Example #1 - Alias Definition:Typing in AddressBar:
@msg Toto
Will pop up the message: "Hello Mr Toto"
---------
Example #2 - Alias Definition:Typing in AddressBar:
@sel _0
Will instantly select files from _01 to _09:
Name_01.jpg
Name_02.jpg
...
Name_09.jpg
---------
Example #3 - Alias Definition:Typing in AddressBar (after selecting all files):
@ren _, " - "
Will instantly rename all your files as (without preview):
Name - 01.jpg
Name - 02.jpg
...
Name - 66.jpg
Arguments are the element(s) you write after the alias name.
They're useful with scripting where your Alias runs a command and the arguments are the values. e.g.
• Alias Definition:
MyAlias=::command <@1>;
• In Address Bar:
@MyAlias Argument
Well, examples are better than words. (#2 and #3 are very useful!
Let's say you've a folder full of files:
Name_01.jpg
Name_02.jpg
...
Name_66.jpg
---------
Example #1 - Alias Definition:
Code: Select all
msg=::msg "Hello Mr <@1>";@msg Toto
---------
Example #2 - Alias Definition:
Code: Select all
sel=::selfilter "<@1>"; focus "L";@sel _0
Name_01.jpg
Name_02.jpg
...
Name_09.jpg
---------
Example #3 - Alias Definition:
Code: Select all
ren=::rename s, '<@1>/<@2>';@ren _, " - "
Name - 01.jpg
Name - 02.jpg
...
Name - 66.jpg
• Scripts: Session Manager
| SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
CookieMonster
Re: Alias Arguments
Setting the Example 1 Alias Definition prompts a dialog box
Changing <@1> prompts;
Code: Select all
=::msg Hello Mr<@1>The above two Aliases don't appear right in how it should work and do I have to keep <@1> or <@2> when creating aliases ?=::msg Hello Mr <@1 CookieMan>
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Re: Alias Arguments
In the address bar type "@" and then paste those examples.
Or open Tools > List Management > Aliases
Click New and paste each one in a new entry.
One of my favorite ways to use them is to shorten addresses.
I have a bunch of projects under C:\Zen\GitHub, so I define an alias:Now if I wanted to jump to C:\Zen\GitHub\Project-1\src I could just enter this in the address bar:
Or open Tools > List Management > Aliases
Click New and paste each one in a new entry.
One of my favorite ways to use them is to shorten addresses.
I have a bunch of projects under C:\Zen\GitHub, so I define an alias:
Code: Select all
@gh=C:\Zen\GitHub\<@0>Code: Select all
@gh Project-1\src-
CookieMonster
Re: Alias Arguments
Last night, I did manage to get the basics of Aliases working that are demonstrated in the documentation 
What arguments can I use for Aliases ? Does <@1>, <@2> etc close the argument, is that their purpose ?
What arguments can I use for Aliases ? Does <@1>, <@2> etc close the argument, is that their purpose ?
XYplorer Beta Club