Get() should not replace Alias arguments in definition.

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Get() should not replace Alias arguments in definition.

Post by TheQwerty »

I don't think Get('Alias', $aliasName); should return an alias' definition with the "<@#>" alias arguments already replaced.
In my case I want to display an alias' actual definition, but if it contains arguments than this is currently impossible.

Or for that matter, maybe it is time for some better scripting support:

Code: Select all

Alias([Operation], [Params]);
Operation:
  • "Add", AliasName, [AliasDefinition]
    • Sets an alias; returns the alias' old definition (or empty string)
  • "Count"
    • Returns the total number of defined aliases.
  • "Get", AliasName
    • Returns an alias' definition (or empty string if none found).
  • "List", [separator='<crlf>']
    • Retrieves a list of all aliases (formatted like user copied contents of list management's edit-mode).
  • "Parse", AliasName, [Arg0]
    • Returns the parsed results of an alias' definition (or empty string) replacing alias arguments by splitting Arg0 (as if the user put it in the address bar).

admin
Site Admin
Posts: 67332
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Get() should not replace Alias arguments in definition.

Post by admin »

TheQwerty wrote:I don't think Get('Alias', $aliasName); should return an alias' definition with the "<@#>" alias arguments already replaced.
In my case I want to display an alias' actual definition, but if it contains arguments than this is currently impossible.
Yes, I'll change this.

I don't feel like adding a new alias command ATM, but thinks for preparing the definition. Might use it later.

I have the funky feeling that you are the only one in the universe actually using the aliases. Anybody else out there?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Get() should not replace Alias arguments in definition.

Post by TheQwerty »

admin wrote:I don't feel like adding a new alias command ATM, but thinks for preparing the definition. Might use it later.
It was quickly drawn up to be similar to Tab(). The only real function of it that I would like to see sooner rather than later is the ability to retrieve all aliases.
admin wrote:I have the funky feeling that you are the only one in the universe actually using the aliases. Anybody else out there?
I sometimes get the same feeling which is disappointing because it really is a fantastic feature when you do a lot of keyboard work.

Maybe it goes hand-in-hand with the fact that I also feel like the only one in the universe that hides the tree and almost never uses it*, since I prefer to get around via address-bar and auto-complete. It's so inefficient moving a hand between keyboard and mouse!

*Though I have rather recently brought it back locked and minimized to my fixed drives.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Get() should not replace Alias arguments in definition.

Post by Stefan »

admin wrote:I have the funky feeling that you are the only one in the universe actually using the aliases. Anybody else out there?
Yes i do too, because i like command line style working:

Some basics
(Open "Tools > List Management > Aliases" and copy this all in there, then close the dialog and enter an alias into the address bar)

Code: Select all

@=::#633; //Tools / List Management / Aliases...#633 //// enter "@@" in address bar to open Alias list
f=::filter "<@0>";  //// enter "@f searchpattern" in address bar; "@f" to see all files again
N=::$a = report("{BaseName}",1); $a = input("New file name", "<curitem>","$a.txt"); new $a, file; run notepad $a;
n=::run notepad; //start notepad   //// enter "@n" in address bar
nc=::run notepad "<curitem>";    //// enter "@nc" in address bar
new=::#230; //New...     //// enter "@new" in address bar
q=::Load anyScriptFile;   //// enter "@q" in address bar to load an often used script
u=::goto "%UserProfile%";  //// enter "@u" in address bar to goto C:\Docum and Settings\username

Post Reply