zer0's Scripts Library

Discuss and share scripts and script files...
Post Reply
zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

zer0's Scripts Library

Post by zer0 »

In this thread I will aim to build a collection of scripts that may be of use to other users of XY. The almighty jacky already has a library of scripts here: http://88.191.26.34/XYscripts/, so I felt that the more I dive into scripting the more scripts I should share. Additionally, quite often I need a small script that would automate a job for me, something I can do with one click of a button instead of two. My scripts won't necessarily be complicated, though they may become more complex as my knowledge of scripting expands. Without further ado...

Remove Extension from file(s)
The purpose of this script is to remove a file's (or files') extension. Sometimes, when you download a file, it looks like xxxx.rar.html or similar. Obviously, you can't extract it until you've removed its extension. With lots of files, this process can be tedious, so here's a quick script that would do the job in an instant.

Code: Select all

"Remove Extension" rename e;
Select all files of a particular type in the current folder
By default, XY includes a column that's called "Ext", which allows you to sort all your files by their extensions. For people who have alternative sorting arrangements and those who don't have that column because they don't want to have it or they need more list pane space this script will select all the files that have the extension specified in the script.

Code: Select all

"Select All [insert type of file here] files" 
 Selfilter *.[insert extension here], f;
  focus l;
for more flexibility, it may be desired to have a pop-up window, in which a user would specify the extension. Script for that is below

Code: Select all

"Select All files of the entered type" 
$a = input("Please type extension");
  Selfilter *.$a, f;
  focus l;
Rename all files as current folder and move up a tree level
On occasions, the files I extracted were put into folders. What I needed to do is to rename files in those folders as those folders and then move them into the directory where those folders are. This script does exactly that.

Code: Select all

Set($cf,<curfolder>);
  Sel(f);
  Rename(b,$cf);
  Focus(L);
  MoveTo("..");
  #523;
  SelFilter($cf, d, Name);
  Focus(L);
  #169;
Save ASCII art files in XYplorer
If you come across some ASCII art on the web then it's possible that it will be shown like this http://pastebin.com/f5e867b85, but with the help of my script and a little more work you'll be able to save them as shown here: http://i40.tinypic.com/v6127p.png. You also need to download the ASCII.zip attachment and install the Terminal font that is in the archive, it's a much better version than the one that Windows has by default. Then, go to XY's configuration, in the Fonts section for Edit Text part change the font to the one you've just installed and choose the appropriate size, I have it set to 10. Run the script, paste your code into it and have it saved as great-looking ASCII art.

Code: Select all

"Save ASCII art" $a = input("Enter ASCII art",,, "m",,690,850); 
  $b = input("Enter Name");
  writefile("<curpath>\$b.nfo", $a);
Renaming a file from clipboard
Quite often, I download an installer for a program that is just called as the name of the program. For me, that's not good enough. Quite often the developer includes the full release name on their web page (you'll need to copy this release name to clipboard), so with this script you can rename your current file(s) as per what is stored in clipboard.

Code: Select all

$a = <clipboard>;
  rename b, $a;
You do not have the required permissions to view the files attached to this post.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: zer0's Scripts Library

Post by zer0 »

It has been a while since I've updated this thread. With intro of CTBs I'll be adding more of the scripts that I use. Do as I speak...

CTB Script to Minimise XY and Lock PC
The purpose of this script is to minimise XYplorer and then lock your machine all in just one click. Could be one of those "Hide from the Boss!" things :mrgreen:
For this CTB you'd need 2 things: XY code and a BAT file. XY code is below

Code: Select all

#1027;
 open "<xypath>\lock_pc.bat";
BAT file is included in the attachment, where you'll also find an nice ICO for your CTB. Just in case, code for BAT file is below

Code: Select all

@echo off
rundll32.exe user32.dll, LockWorkStation
cls
You do not have the required permissions to view the files attached to this post.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: zer0's Scripts Library

Post by aurumdigitus »

zer0 wrote:The purpose of this script is to minimise XYplorer and then lock your machine all in just one click. Could be one of those "Hide from the Boss!" things
Clever idea; nice icon. Used up last CTB to implement. :(

Post Reply