xyScript - Clients Forms/Cadastre.

Discuss and share scripts and script files...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

xyScript - Clients Forms/Cadastre.

Post by SkyFrontier »

This little script (took me almost 8 hours to write it - :? ) will:
-pop a window asking for client's name;
-grab a template out of <xydata>\NewItems (YourCompany_Form.rtf, in case) and copy it on current location;
-rename it as YourCompany_Form_Entered Name of the Client.rtf;
-rename diacritics as specified (adapt this to match your needs): "ñáàâãéèêíìîóòôõúùûç.,[]{}()>>naaaaeeeiiioooouuuc________".
NOTE: This step has a limitation regarding names collision. Later I will post a note asking for a solution (it seems to be a "rename s" issue, since "rename b" deals pretty well with name collisions when "/i" switch is part of the code - stay tuned!;
-do a basic camelCasing (if you don't like it, disable the "rename s, " /";" part using the "//" comment parameter;
-open the document and
-having the client's name waiting on clipboard!

Nice way to impress some people around there, huh?
8)

Code: Select all

//ok - Clients Form
   $in = input("Enter Client's Name:");
   backupto "<curpath>", "<xydata>\NewItems\YourCompany_Form.rtf", 4;
   selfilter "YourCompany_Form.rtf";
// "/i" to avoid name collision
   rename b, "*_$in/i", "YourCompany_Form.rtf";
   rename s, "ñáàâãéèêíìîóòôõúùûç.,[]{}()>>naaaaeeeiiioooouuuc________";
   rename s, " /";
   copytext $in;
   status "Register Created: $in";
   sendkeys"{enter}";
//   open "<curpath>\<curitem>";
Scripters: revisions and comments are welcome!

Tag - xyScript
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...

Post Reply