Share your buttons!

Discuss and share scripts and script files...
serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Share your buttons!

Post by serendipity » 05 Dec 2009 00:16

I am creating this thread so that anyone who uses customized buttons on their toolbar can share their button codes with others. And optionally upload their icons.

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

I copied the code from the "[CustomButtons]" section from my XYplorer.ini file after i created the button and subsequent restart.

What does this button do:
Based on this thread http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=4384, i made a simple script/button. If you left-click on the button you will get normal sort options offered by XY, while if you right-click you will get different sort options which will "Sort Folders Apart" if you sort by Name, Ext, Size or Type but will remove "Sort Folders Apart" option if you sort by Created, Modified or Accessed.


How to use:
Simply copy/paste the below code into Try script or catalog and run it ONLY once. This will first save your settings, then read/write some settings and finally will restart XY. The new button will be last one in the Customize toolbar's "Current buttons" list.

Code: Select all

//Save settings
  #182;
//Getkeys
  getkey $count, "count", "CustomButtons";
  getkey $toolbar, "Toolbar", "General";

//Increment count  
  incr $count;
//Button code
  $button= <<<BUTTONCODE
"Sortby|:sort|0" "XYSort|:sort" button "sort"	"Name"¶¶  global $sort;¶¶  $sort=name;¶¶  sub "_eval";¶¶  ¶¶"Ext"¶¶  global $sort;¶¶  $sort=ext;¶¶  sub "_eval";¶¶¶¶"Size"¶¶  global $sort;¶¶  $sort=size;¶¶  sub "_eval";¶¶¶¶"Type"¶¶  global $sort;¶¶  $sort=type;¶¶  sub "_eval";¶¶¶¶"Created"¶¶  global $sort;¶¶  $sort=created;¶¶  sub "_eval";¶¶¶¶"Modified"¶¶  global $sort;¶¶  $sort=modified;¶¶  sub "_eval";¶¶¶¶"Accessed"¶¶  global $sort;¶¶  $sort=accessed;¶¶  sub "_eval";¶¶¶¶¶¶¶¶"eval : _eval"¶¶  global $sort;¶¶  IF ($sort=="name"){¶¶  sub "_nodate";¶¶  }¶¶  ELSEIF ($sort=="ext"){¶¶  sub "_nodate";¶¶  }¶¶  ELSEIF ($sort=="size"){¶¶  sub "_nodate";¶¶  }¶¶  ELSEIF ($sort=="type"){¶¶  sub "_nodate";¶¶  }¶¶  ELSEIF ($sort=="created"){¶¶  sub "_date";¶¶  }¶¶  ELSEIF ($sort=="modified"){¶¶  sub "_date";¶¶  }¶¶  ELSEIF ($sort=="accessed"){¶¶  sub "_date";¶¶  }¶¶  ¶¶"Non-date : _nodate"¶¶  global $sort;¶¶  Settingp SortFoldersApart,1;¶¶  //Settingp KeepFoldersOnTop,1;¶¶  Sortby $sort, clk;¶¶¶¶"Date : _date"¶¶  global $sort;¶¶  Settingp SortFoldersApart,0;¶¶  Sortby $sort,clk;
BUTTONCODE;
//Setkeys
  setkey $count, "count", "CustomButtons";
  setkey $button, $count, "CustomButtons";
//append button to current buttons list and setkey
  $toolbar=$toolbar.",ctb$count";
  setkey $toolbar, "Toolbar", "General";
//Restart without saving
  #190;
For those who are interested in sharing their codes, paste your codes between <<<BUTTONCODE and BUTTONCODE above.
Note however that the code in the Xyplorer.ini file will have extra quotes, remove the first and last quote before pasting it.

Feedback/Comments/Criticisms welcome. :D

Update: The above code won't work as the forum software removed some spaces. Instead download the file below, Select the file and run it from menu "Scripting | Load selected script file"
ExampleButton.xys
(1.52 KiB) Downloaded 378 times

serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Share your buttons!

Post by serendipity » 10 Dec 2009 21:06

UPDATE: 7 Oct 2013
Removed the XYS file. Use the feature ::snippet to make new button on-the-fly. See How to: below

Favorite button- Combines favorite folder and favorite files button:
1) Left click: fav folder, fav file
2) Right click: fav folder, Toggle fav folder, Manage fav folder | fav file, Toggle fav file, Manage fav file.
Favs.png
Favs.png (13.26 KiB) Viewed 9317 times
Icon used:
MyFavsIcon.zip
(2.01 KiB) Downloaded 385 times
How to:
1) Type ::snippet in the address bar and hit enter.
2) Paste the below code and OK. That's it!
Note: Make sure you have the attached icon in XY's Icon folder.

Code: Select all

Snip: CTB 1
  XYplorer 13.00.0008, 13.04.2011 08:51:37
Action
  NewUserButton
Name
  Fav Folder and Files
Icon
  MyFavs.ico
ScriptL
  "Fav Folder|:favs"
    button "favs";
  "Fav Files|:favfiles"
    button "favfiles";
ScriptR
  "Favorite folder|:favs" 
    button "favs";
  "Toggle favorite folder" 
    #566;
  "Manage Favorite folders" 
    #612;
  "-"
  "Favorite files|:favfiles" 
    button "favfiles";
  "Toggle favorite file"  
    #565;
  "Manage Favorite files" 
    #613;
FireClick
  1

serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Share your buttons!

Post by serendipity » 20 Dec 2009 01:17

My Computer button- The default left-click options plus more options on right-click.
MyComputer_Button.png
MyComputer_Button.png (21.54 KiB) Viewed 9255 times
Download the below script and run once ONLY.
MyComputer_Button.xys
(1.03 KiB) Downloaded 476 times
And if you like it, remove the default my computer button. :)

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Germany, EU

Re: Share your buttons!

Post by Stefan » 20 Dec 2009 02:44

Good idea serendipity.

First let me add an little how to about CTB ("Custom Toolbar Buttons"):
See introduce of CTB at http://www.xyplorer.com/release_8.40.htm
CTB_HowTo.PNG
Basics about CTB
CTB_HowTo.PNG (70.98 KiB) Viewed 9219 times
5) Edit User Button:
Name: the tool tip, just an name or an description for this button. (like 'User Button #15' above)
Icon: path to an ICO file, or an EXE file, or an ICL file. Use /n to access an Icon from an EXE or from the Icon Library.
  (Examples: "path\icon.ico" or "path\ICONS\smily folder.icl /53" or "..\Beyond Compare 3\BCompare.exe" or "xyplorer.exe /2")
On Click: add an on-liner script, or click [Edit…] to write multi-line script, or LOAD to call an *.xys script file.
On right-click: LOAD an *.xys script to use this to show an context menu.





And now,
Here is my kind of myco button.
That is just an collection of ideas i had over the last months, to make the work with XY easy for my kind of use, but i am still not satisfied with it, but as always with improvisation... it just works and is enough for me right now, and i enjoy doing other things rather then improving this :lol:

Explanation of my myco picture:
1) i had add an "L"-icon for the left/top and an "R" for the right/down pane (see attachment, they are not good, but better then nothing)
2) my CTB settings
3) The script for the left click is just [ Focus "P1"; button "myco"; ] which focus pane1 and call standard myco command
4) For the right click i load an script file called myco: [ Load ctb\myco; ] where i collect some useful commands and some favorite UNC paths
5) i add also an shortcut to this button via UDC with the same code as for the left click: [ Focus "P1"; button "myco"; ] That way i press Alt+F1, the myco dialog pops-up, and i chose the drive to go to.
XY_myco.PNG
Illustration of my CTB customizing
XY_myco.PNG (71.69 KiB) Viewed 9245 times

myco.xys

Code: Select all

"\\server.lan.de"
 GoTo "\\server.lan.de\";
-
"Recent Locations|:mru" button "mru"
"Hotlist|:hotlist" button "hotlist"
"MyComputer|:myco" button "myco"
"Drives|:drives" button "drives"
"Browse Network|:browsenetwork" button "browsenetwork"
"Favorite Folders|:favs" button "favs"
"Favorite Files|:favfiles" button "favfiles"
"Tab List|:tablist" button "tablist" //"Ctrl+Shift+T Tablist...	#538"

-
"Edit this &script : edit"
   self $ScriptFile, file;
   OpenWith "<xypath>\Tools\NotePad2\Notepad2.exe", ,$ScriptFile;


###################################

how to put one of internal icons for a button?

You have to use the internal name of the build-in buttons.
For example the internal name for "MyComputer" is "myco".
You can use the internal icon by using :myco
That's an colon : followed by the internal name.



The internal names for the current toolbar you can get with the following script:
text toolbar();



You can get an list of all the buttons following this steps:

(see XYplorer help file too: Scripting Commands Reference > button and toolbar)


First save all XYplorer setting > menu "File > Settings > Save all settings"
(or use an other non-install XY version just temporary for this issue)


- now save your current toolbar just to be sure:
$CurrentToolbar = toolbar();
writefile("<xydata>\CurrentToolbar.txt" , $CurrentToolbar);



- now add all (or the one you are interested in) buttons to the toolbar.


- then execute again an script to get this internal names too:
$CompleteToolbar = toolbar();
writefile("<xydata>\CompleteToolbar.txt" , $CompleteToolbar);


That will get you an list like this:

(CompleteToolbar.txt from v9.70.0000 - 2010-11-03)
CompleteToolbar.txt wrote: back,fore,up,mru,-,myco,newfolder,find,openwith,-,copy,go,hotlist,drives,browsenetwork,refresh,
autorefresh,refreshsus,stop,props,copypath,previewfull,qfv,favs,favfiles,tags,findtag,cut,clip,mo
veto,copyto,backupto,lasttarget,goprev,rename,nuke,queue,netmap,netunmap,dosbox,hidenav,t
reeshow,syncscroll,hightree,panellast,panelmax,sort,views,viewdetails,viewlist,viewthumbs,zoo
min,zoomout,exitnosave,udc,cks,fvs,lstmgmt,calcfosi,home,newtab,closetab,locktab,tablist,sho
whidden,showsystem,showfolders,visualfilter,sticky,steps,paste,del,-,undo,redo,-,minitree,dp,dp
12,panelshow,cat,preview,-,conf,ctb1,ctb2,ctb3,savesett
See this too > http://www.xyplorer.com/xyfc/viewtopic. ... 002#p38002


Now for restore load your old toolbar from CurrentToolbar.txt,
$CurrentToolbar = readfile("<xydata>\CurrentToolbar.txt");
toolbar("$CurrentToolbar");


Or just restart XYplorer without saving.




###################################

Here is an script to save and load toolbars:

Code: Select all

"Save current toolbar to file"
   $CurrentToolbar = toolbar();
   $File = inputfile("<xydata>", ,"Chose or create file to save toolbar");
   writefile("$File" , $CurrentToolbar); //CurrentToolbar.txt
   msg "Done.<crlf>$File";
"Load toolbar from file"
   $File = inputfile("<xydata>", ,"Chose file to load toolbar");
   $CurrentToolbar = readfile("$File"); //CurrentToolbar.txt");
   toolbar("$CurrentToolbar");

.
Attachments
L-R_ico.zip
The Left.ico and Right.ico files
(489 Bytes) Downloaded 213 times
Last edited by Stefan on 08 Feb 2011 09:27, edited 5 times in total.

admin
Site Admin
Posts: 46936
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Share your buttons!

Post by admin » 20 Dec 2009 09:50

serendipity wrote:My Computer button- The default left-click options plus more options on right-click.
MyComputer_Button.png
Download the below script and run once ONLY.
MyComputer_Button.xys
And if you like it, remove the default my computer button. :)
Cool, works sweet! Thanks! :D

serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Share your buttons!

Post by serendipity » 20 Dec 2009 17:14

admin wrote:
serendipity wrote:My Computer button- The default left-click options plus more options on right-click.
MyComputer_Button.png
Download the below script and run once ONLY.
MyComputer_Button.xys
And if you like it, remove the default my computer button. :)
Cool, works sweet! Thanks! :D
:) Glad you like it, hardest part was to find common icons that work on XP and Windows 7 (probably Vista too).
PS: Does having icons affect XY menu speed considerably? If so, i will keep it plain like you do.

admin
Site Admin
Posts: 46936
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Share your buttons!

Post by admin » 20 Dec 2009 17:38

serendipity wrote:
admin wrote:
serendipity wrote:My Computer button- The default left-click options plus more options on right-click.
MyComputer_Button.png
Download the below script and run once ONLY.
MyComputer_Button.xys
And if you like it, remove the default my computer button. :)
Cool, works sweet! Thanks! :D
:) Glad you like it, hardest part was to find common icons that work on XP and Windows 7 (probably Vista too).
PS: Does having icons affect XY menu speed considerably? If so, i will keep it plain like you do.
I don't note any speed issues here; and if it all it would be only once because the menu icons are cached by XY internally.

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Share your buttons!

Post by SkyFrontier » 17 Oct 2010 00:55

This one is cool:

Code: Select all

"Shows All Tagged FILES!|:favfiles"
   goto "*?tag:*";
   focus;
   filter "!\|*"; //hide all folders|show files only
   selfilter , f;
"Shows All Tagged FOLDERS!|:showfolders"
   goto "*?tag:*";
   focus;
   filter "\|!*"; //hide all files|show folders only
   selfilter , d;
An alternate version (finds all tagged items):

Code: Select all

"Shows All Tagged Items!|:favs"
   goto "*?tag:*";
-but the coolest usage suggestion to "Show All Tagged Folders" is to have it as a mean to quickly gather target folders all over the system together and use that as a way to spread the same set of files/folders to those tagged folders. Here's how. Works great when you want to backup stuff on different locations at once... :wink:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

lawvol
Posts: 17
Joined: 06 Feb 2012 15:53

Re: Share your buttons!

Post by lawvol » 24 Feb 2012 17:04

serendipity wrote:Favorite button- Combines favorite folder and favorite files button:
1) Left click: fav folder, fav file
2) Right click: fav folder, Toggle fav folder, Manage fav folder | fav file, Toggle fav file, Manage fav file.
Favs.png
Download the below xys file, select it and run it ONLY once (eg: menu "Scripting > Load selected script file"):
Favsbutton.xys
After XY restarts, you will find it in the far end of the toolbar, you can set any icon to it. Maybe this icon too:
MyFavsIcon.zip
Would it be possible for someone to post this as a text file showing what needs to go in each field on the custom button screen? I can't seem to get this to work correctly as a script and was trying to manually create a button for this, but can't quite seem to get it right.

I really only need the script for:

Right Click:
and
Left Click:

Thanks...
» Lawvol on Twitter || My Setup: XYplorer v 12.80Windows7 Pro 64bit • Lifetime License Pro

serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Share your buttons!

Post by serendipity » 24 Feb 2012 17:16

lawvol wrote:
serendipity wrote:Favorite button- Combines favorite folder and favorite files button:
1) Left click: fav folder, fav file
2) Right click: fav folder, Toggle fav folder, Manage fav folder | fav file, Toggle fav file, Manage fav file.
Favs.png
Download the below xys file, select it and run it ONLY once (eg: menu "Scripting > Load selected script file"):
Favsbutton.xys
After XY restarts, you will find it in the far end of the toolbar, you can set any icon to it. Maybe this icon too:
MyFavsIcon.zip
Would it be possible for someone to post this as a text file showing what needs to go in each field on the custom button screen? I can't seem to get this to work correctly as a script and was trying to manually create a button for this, but can't quite seem to get it right.

I really only need the script for:

Right Click:
and
Left Click:

Thanks...
The undocumented and unofficial command ::snippet is better than this, see here:
http://www.xyplorer.com/xyfc/viewtopic. ... 494#p58494

BTW, what button do want to create and what should be on left and right click?

lawvol
Posts: 17
Joined: 06 Feb 2012 15:53

Re: Share your buttons!

Post by lawvol » 28 Feb 2012 15:30

serendipity wrote: The undocumented and unofficial command ::snippet is better than this, see here:
http://www.xyplorer.com/xyfc/viewtopic. ... 494#p58494

BTW, what button do want to create and what should be on left and right click?
Actually, I think I figured it out. It seems to be working now.

One problem I am still having, however, is figuring out how to make a button that:
  • Lists Assigned Names (i.e. "My Notes" Instead of "C:/Users/Name/My Documents/My Notes"
  • Displays a custom Icon for the Folder link
I can get the custom Icons, but only with path names, and can get the Custom names but not with icons of any sort.

Could some one give me a single line example of how I can insert into a button:
  • a path to a folder;
  • an assigned name for that folder; and
  • a path to an icon that I want to use for that link
I've tried about everything I can think of and can't seem to get that to work.

Again, thanks for helping out the Noob...
» Lawvol on Twitter || My Setup: XYplorer v 12.80Windows7 Pro 64bit • Lifetime License Pro

serendipity
Posts: 3347
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Share your buttons!

Post by serendipity » 28 Feb 2012 17:12

lawvol wrote:
serendipity wrote: The undocumented and unofficial command ::snippet is better than this, see here:
http://www.xyplorer.com/xyfc/viewtopic. ... 494#p58494

BTW, what button do want to create and what should be on left and right click?
Actually, I think I figured it out. It seems to be working now.

One problem I am still having, however, is figuring out how to make a button that:
  • Lists Assigned Names (i.e. "My Notes" Instead of "C:/Users/Name/My Documents/My Notes"
  • Displays a custom Icon for the Folder link
I can get the custom Icons, but only with path names, and can get the Custom names but not with icons of any sort.

Could some one give me a single line example of how I can insert into a button:
  • a path to a folder;
  • an assigned name for that folder; and
  • a path to an icon that I want to use for that link
I've tried about everything I can think of and can't seem to get that to work.

Again, thanks for helping out the Noob...
Hi,
I am pasting a script showing system info and control panel etc:

Code: Select all

"System info|C:\Windows\System32\shell32.dll /24"
  run "msinfo32";
-
"Control panel|C:\Windows\System32\shell32.dll /22"
  #640;
Caption and icon go on first line separated by a |. So in the first line:
"Control panel|C:\Windows\System32\shell32.dll /22"
Control panel is caption and C:\Windows\System32\shell32.dll /22 is my icon. Second line is the script itself, like goto or run or open etc. You can also have the whole thing in one line like i show below (I showed two lines just to make it clear). In your case you can paste something like this in your on-click or on right-click filed:

Code: Select all

"My Notes | path to your Notes icon"  goto "C:/Users/Name/My Documents/My Notes"
"My Favorites | path to your Fav icon"  goto "C:/Users/Name/My Documents/Favorites"
Hope that helps.

lawvol
Posts: 17
Joined: 06 Feb 2012 15:53

Re: Share your buttons!

Post by lawvol » 28 Feb 2012 21:43

Thank you so much.

I was closer than I thought, which makes me feel a little better. I just didn't get the fact that I could put an icon path after the "|" character.

I really appreciate your help!
» Lawvol on Twitter || My Setup: XYplorer v 12.80Windows7 Pro 64bit • Lifetime License Pro

binocular222
Posts: 1410
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Share your buttons!

Post by binocular222 » 01 Jan 2013 04:20

I have only 1 button in toolbar:
Left click:

Code: Select all

button mru
Right click:

Code: Select all

load "Toolbar"
Inside Toolbar.xys:

Code: Select all

"_Initialize"
	perm $HiddenFile;
	perm $SystemFile;
	perm $VirtualDrive;
	perm $Winmount;
	$HiddenFile = get("#493", "Hide &Hidden files", "Show &Hidden files");
	$SystemFile = get("#494", "Hide &System files", "Show &System files");
	If( strpos(get("drives", 5), <curitem>) != -1) {$VirtualDrive = "Compress"};
	ElseIf(strpos("iso|bin|nrg|daa|cdi|cue|ccd|mds|mdf|img|isz", "<curext>") == -1 ) {$VirtualDrive = "Unmount all Virtual Drive"}; 
	Else {$VirtualDrive = "Mount as Virtual Drive"};
	$Winmount = "E:\2System\Virtual drive\WinMount\WinMount.exe"
"_Terminate"
	unset $HiddenFile;
	unset $SystemFile;
	unset $VirtualDrive;
	unset $Winmount

"&Eject USB|<xypath>\icon\USB.ico" run "E:\7Utilities\USB_Disk_Eject\USB_Disk_Eject.exe" "/removeletter" "get("drives", 2)"
"$HiddenFile|:showhidden" #493; status "Hidden files: ". get("#493", "Show", "Hide"). " | System files: ". get("#494", "Show", "Hide")
"$SystemFile|:showsystem" #494; status "Hidden files: ". get("#493", "Show", "Hide"). " | System files: ". get("#494", "Show", "Hide")
"&Avira Antivirus scan|<xypath>\icon\Avira.ico" $path = trim(<curitem>,"\"); run "E:\2System\Antivirus\Avira Command Line Scanner\scancl.exe" "$path" "--allfiles --defaultaction=ask --fixallboot --heurlevel=1 --log=Log.txt --logformat=singleline"
"&Unlocker|<xypath>\icon\Unlocker.ico" Load "PFA", "Unlocker"
"&Tag search|:tagsfind" sub "_TagSearch"
"&Items with similar tag|:tagsset" sub "_SimilarTag"
-
"Compare with file in clipboard|<xypath>\icon\Black white.ico" #226
"&Firewall|<xypath>\icon\FirewallRed.ico" sub "_Firewall"
"$VirtualDrive|<xypath>\icon\CD-ROM3.ico" sub "_$VirtualDrive"
"Toggle favourite folder|:favs" #566
"Label manager|:labels" load "Label manager"
"Queue file operation|:queue" button queue;
"Check for update|:shellprops" load "SimpleUpdater"
-
"Sticky selection|:sticky" button sticky
"Invert selection|<xypath>\icon\cursor white.ico" #252
"Selection Filter [,]|<xypath>\icon\cursor.ico" #253
-
"Minitree [Shift+T]|:minitree" button minitree
"Menu bar [Shift+M]|:props" #1061
"cmd [Shift+P]|:dosbox" button dosbox
"Hotlist [Shift+H]|:hotlist" button hotlist
"Folder size [Shift+S]|:calcfosi" button calcfosi
"Undo [Ctrl+Alt+Z]|:undo" button undo, 8
"Paste image to file [Ctrl+Alt+V]|<xypath>\icon\camera.ico" #206
"Save tag [Shift+Q]|:tagsadd" #195
"Visual filter [.] [Shift+.]|:visualfilter" #354
"Branch view [Shift+B]|:flatview" button flatview
"Show/hide menu bar [Shift+M]|<xypath>\icon\cursor.ico" #1061
"Find file [Shift+F]|:find" #260
"Search && replace [Shift+F2]|:rename" #123
"Exit no save|<xypath>\icon\Stop.ico"    #191

//Define sub-function here:
"_Tagsearch"
 $data=readfile("<xydata>\tag.dat");
 $String=gettoken($data,2,<crlf>);
 $Count = 1+ strlen(regexreplace($String,"[^;]",""));
 $Labelinuse = "";
 While ($Index < $Count) {
 $Labelinuse = gettoken(gettoken($String,$Count - $Index,";"),1,"|")  . ", " . $Labelinuse;
 incr $Index;
 }
 $Labelinuse = trim($Labelinuse, ", ");
 $Taginuse = getkey("TagsList", "Settings");
 $input = input(Search by Label | Tags | Comment   (Separate by  | )<crlf>Example:    Email  | sale report |Maria     (leave blank to view all tags database),Tags in use: $Taginuse<crlf>Label in use: $Labelinuse,|,s,,300,10);
 $Label = "lbl:" . gettoken($input,1, "|") . "*";
 $Tags = " AND tags:" . gettoken($input,2, "|") . "*";
 $Comment = " AND cmt:" . gettoken($input,3, "|") . "*";
	$Search = "*?:" . $Label . $Tags . $Comment;
	goto "$Search"
	
//MountISO
"_Mount as Virtual Drive"
    $AllDrive = C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z;
    $UsedDrives = replace(get("drives"), ":\") . |;
    $Position = 0;
    $Drive = C;
    While($Drive != ""){
    $Drive = substr($UsedDrives,$Position,2);
    $AllDrive = replace($AllDrive,$Drive);
    $Position = $Position + 2;
    };

    If( strpos("iso|bin|nrg|daa|cdi|cue|ccd|mds|mdf|img|isz", "<curext>") == -1 ) {Status "Not image file", ,"stop"; end 1};
    Else
    {
     $drive = inputselect("Currently selected item:<crlf><curitem>", $AllDrive,,2,,650,450, "Select drive letter for new Virtual Drive");
     end(strlen($drive) > 1), "Please select only one check box, script ends.";
     OpenWith """$Winmount"" -m <items> -drv:$drive:";
     wait(2000); // wait 2 seconds
     tab("new", $drive:);
    }

"_Unmount all Virtual Drive" run """$Winmount"" -unmountall";

"_Compress" Run """$Winmount"" -C <curitem>";

"_SimilarTag"
  $Label = trim(formatlist(report("{Label} or ",1), "de"), " or");
  $Tag = trim(formatlist(report("{Tags} or ",1), "de"), " or");
  $Comment = trim(formatlist(report("{Comment} or ",1), "de"), " or");
  If(report("{Label}", 1) != "") {$CountLabel = 1;  $Label = " AND lbl:" . $Label};
  If(report("{tags}", 1) != "") {$CountTag = 1;  $Tag = " AND tags:" . $Tag};
  If(report("{Comment}", 1) != "") {$CountComment = 1;  $Comment = " AND cmt:" . $Comment};
	If ($CountLabel + $CountTag + $CountComment == 1) {$Temp = "*?" . $Label . $Tag . $Comment ; $Search = replace($Temp, " AND "); Tab("new"); goto "$Search"};
	Elseif ($CountLabel + $CountTag + $CountComment > 1) {$Temp = "*?:" . $Label . $Tag . $Comment ; $Search = replace($Temp, ": AND ", ":"); Tab("new"); goto "$Search"};
	Else {Status Selected item has neither Label nor Tag nor Comment,,"stop"}

"_Tag add"
 $Taglist = formatlist(getkey("TagsList", "Settings") . ", " . property("#tags") . ", ",  "etsd", ",");
 $Clipboard = replacelist( substr(<clipboard>, ,20), "<crlf>"",|;""");
 $MenuItem = trim(popupmenu($Taglist . ",-,$Clipboard,-,&New tag,&Edit tag database,&Clear all",,,,,, ","));
 if( $MenuItem == "&New tag") { #881};
 Elseif( $MenuItem == "&Edit tag database") {setkey( input("Edit Tag database in xyplorer.ini",,getkey("TagsList", "Settings")), "TagsList", "Settings")};
 Elseif ( $MenuItem == "&Clear all") {tag; #886; tag,,2};
 Elseif( strpos(property("#tags"), $MenuItem) == -1) {tag $MenuItem,, 1};
 Elseif ( $MenuItem != "") {tag $MenuItem,,1,2}

"_Firewall"
 $input = input(Add|Delete firewall rule<crlf>Example:,add rule name="XYplorer" dir=out action=Block program="E:\XYplorer\XYplorer.exe" protocol=TCP localport=80<crlf>delete rule name="XY Update" dir=in action=block remoteip="80.237.132.225",name="<curname>" dir=out action=Block program="<curitem>" remoteip=,s,,,);
 if(strpos($input,"remoteip") == -1) {Run "netsh advfirewall firewall add rule $input"}; Else{
 $Len = strlen($input);
 $StartDomain = strpos($input,"remoteip");
 if(strpos($input," ",$StartDomain) == -1) {$EndDomain = strlen($input)}; else {$EndDomain = strpos($input," ",$StartDomain)};
 $Domain = substr($input, $StartDomain+10, $EndDomain - $StartDomain - 11);
 $TestDomain = gettoken($Domain,"count",".");
 if($TestDomain > 3) {Run "netsh advfirewall firewall add rule $input"}; Else {
 run "<xyscripts>\NSLookup.bat $Domain";
 wait 2000;
 $data = readfile ("<xyscripts>\NSLookupResult.txt",t,,,50);
 $Count = gettoken($data,"count",<crlf>);
 if( $Count < 3) {msg cannot find IP address}; else {
 $String = gettoken($data,-2,<crlf>);
 $IP = trim(replacelist($String,"Address:|<tab>",,"|"));
 $input2 = replace($input,$Domain,$IP);
 Run "netsh advfirewall firewall add rule $input2"};
 }
 }

//http://technet.microsoft.com/en-us/library/dd734783(v=ws.10).aspx
//http://support.microsoft.com/kb/947709
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

yusef88
Posts: 945
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: Share your buttons!

Post by yusef88 » 07 Oct 2013 00:36

serendipity wrote:Favorite button- Combines favorite folder and favorite files button:
1) Left click: fav folder, fav file
2) Right click: fav folder, Toggle fav folder, Manage fav folder | fav file, Toggle fav file, Manage fav file.
Favs.png
Download the below xys file, select it and run it ONLY once (eg: menu "Scripting > Load selected script file"):
Favsbutton.xys
After XY restarts, you will find it in the far end of the toolbar, you can set any icon to it. Maybe this icon too:
MyFavsIcon.zip
:eh: Unfortunately does not work with XY 13

Post Reply