Page 1 of 1

Share your (XYplorer) Aliases

Posted: 26 Jan 2015 13:25
by bdeshi
imitating serendipity:
===
I am creating this thread so that anyone who uses aliases (the feature of XY, not your alternative names) can share their codes with others. And optionally also usage instructions for the arguments.

I am sharing the below code just as an example, so that others can follow if interested.

===

Find <@2> percent of <@1>:

code

Code: Select all

@%of=::echo "<@2 100>% of <@1 100> is:<crlf 2>".(<@2>*<@1>/100);
use

Code: Select all

@%of [BASE NUMBER], [PERCENTAGE]
example

Code: Select all

@%of 37, 766856

Re: Share your (XYplorer) Aliases

Posted: 28 Jan 2015 08:08
by bdeshi
Set one or more ini keys:
and restart XY to apply them (allows optionally saving current settings first)

code

Code: Select all

@setting=::$k='<@1>';$s='<@2>';$t="<@3 <@1>>";$d="<@4>";if (confirm("XY will restart to apply the setting.<crlf 2>save current settings beforehand?")==1){savesettings} $n=gettoken($k,count,'|');$c=1;while ($c<=$n){$key=gettoken($k,$c,'|');$sec=gettoken($s,$c,'|');$tpc=gettoken($t,$c,'|');$dsc=gettoken($d,$c,'|');setkey input($tpc,$dsc,getkey($key,$sec),s),$key,$sec;$c++} exit nr;
use

Code: Select all

@setting, [KEY(s)],[SECTION(s)],[TOPIC(s)],[NOTE(s)]
multiple keys can be used, |-separated. Then matching |-separated Sections must be used.
Topic title text is optional and is substituted with keyname(s) by default (else |-septd text). description note is empty by default, else |-septd text.
example

Code: Select all

@setting RegExpRenameSep, General

Code: Select all

@setting TabIPVisualStyle|TabIPUseCustomColors, Settings|Settings,, "allowed values: 0=shadow style,1=xy style,2=flat|allowed values: 0=no, 1=yes"

Re: Share your (XYplorer) Aliases

Posted: 28 Jan 2015 12:10
by PeterH
No one did notice? Typo in example in very first post...

Code: Select all

not:
@%of=::echo "<@2 100>% of <@2 100> is:<crlf 2>".(<@2>*<@1>/100);
but:
@%of=::echo "<@2 100>% of <@1 100> is:<crlf 2>".(<@2>*<@1>/100);
:cup: (Tea!)

Re: Share your (XYplorer) Aliases

Posted: 28 Jan 2015 12:25
by bdeshi
:tup:
actually it was initially

Code: Select all

@%of=::echo "<@1 100>% of <@2 100> is:<crlf 2>".(<@2>*<@1>/100);
(although the result is the same) I'd swapped the first one, but forgot the second. :lol:

Re: Share your (XYplorer) Aliases

Posted: 28 Jan 2015 14:49
by Stefan
SammaySarkar wrote:I am creating this thread so that anyone who uses aliases can share their codes with others. And optionally also usage instructions for the arguments.
Some ideas:

(Open "Tools > List Management > Aliases", copy the wanted alias in there, (without the ////-comments)
close the dialog, press Ctrl+Alt+A to focus the address bar and enter an alias into there. Press Enter-key to execute.)


////Tools/List Management/Aliases...#633 //// enter "@@" in address bar to open Alias list
@=::#633;

//// enter "@f searchpattern" in address bar; Plain "@f" to see all files again
f=::filter "<@0>";

//// enter "@N" to create a new txt file, based on base name of CurItem (yes, it's an old way of doing this)
N=::$a = report("{BaseName}",1); $a = input("Create new file; name:", "<curitem>","$a.txt"); new($a,file); run notepad $a;

////start notepad //// enter "@n" in address bar
n=::run notepad;
or
nc=::run notepad "<curitem>";

////New... //// enter "@new" in address bar to get the New Item menu
new=::#230;

//// enter "@q" in address bar to load an often used script
q=::Load anyScriptFile;

//// enter "@u" in address bar to goto C:\Documents and Settings\username
u=::goto "%UserProfile%";
or
U=::goto "%personal%";

//// Cursor on file "DirectoryMonitorLog.txt", enter "@send mum" >> get text in clipboard, ready to copy into my diary
//// Have send file "DirectoryMonitorLog.txt" at 28.01.2015 14:47:26 to mum
send=::copytext "Have send file " . quote("<curname>") . " at <date> to " . '<@1>';

//// @T some text >>> get "some text 28.01.2015 14:47:51" into clipboard
T=::copytext <@1> <date>;


Who can share better ones?
 

Re: Share your (XYplorer) Aliases

Posted: 30 Jul 2015 06:32
by bdeshi
//// throws a makeshift 6-sided dice.

Code: Select all

@dice=::$rand=rand(1,6);html("<body style='background-color:#242424;color:#efefef;'><div style='width:100%;height:100%;font-size:1000%;text-align:center;'>".$rand.'</div></body>');
//// another version throws two 6-sided dices.

Code: Select all

@dice2=::$rand1=rand(1,6);$rand2=rand(1,6);html("<body style='background-color:#242424;color:#efefef;'><div style='width:100%;height:100%;font-size:1000%;text-align:center;'>".$rand1.'+'.$rand2.'</div></body>');
after adding the aliases, enter @dice (or @dice2) in addressbar. Then you just have to press ENTER twice to throw again.