Using Script Instead of Bullets and Numbering.

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

Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Years ago I needed to create a series of links such:

Code: Select all

http://www.test.com/download/1/text
...
http://www.test.com/download/520/text
OpenOffice's Bullets and Numbering was a central part of the process, but still time consuming and requiring human intervention.
Using this script (thanks again, Stefan!), I was able to accomplish the same, without any kind of intervention other than setting initial parameters for the script (and a little search and replace at the end of the process). As follows:

1) Copy the ending URL into a visible .txt, for refer;
2) Chose an empty folder and activate the mentioned script;
3) Chose either to create as folders (leave Option 1 checked/default) or files (tick Option 2). *NOTICE*: In a task, I had to create +4000 of such entries and experimentally started with FOLDERS - the whole process slowed down severely after the first ~800 folders and I opened another XY instance and regularly selected all from the source folder and moved them into another temp directory, creating groups of ~1000 files/max; side notice: if you click on the opposite panel, the script will continue to create folders in it, so you must set the original pane as active again and on task completion you'll need to gather those stranded folders together; also, keep an eye on the bug described here (beta 9.40.0000/0001 at least, regarding drag'n'drop into highlighted folders on the opposite pane); creating FILES may be a bit more comfortable, but haven't properly tested it yet;
4) Split the initial URL as follows:
-Option 5: http-www.test.com_download_
-Option 6: 1
-Option 7: 520
-Option 8: _text
5) Click on "Do it", confirm with OK and enjoy the show; keep in mind the notice on item 3;
6) After sorting stuff together (if you had to split them apart), select all files/folders and copy their names into clipboard (default CTRL+SHIFT+P or File > To Clipboard > Item Name(s);
7) Open Wordpad (or your favorite text editor) and paste (CTRL+V) the info into it;
8) Do a little search and replace with "- >> ://" and "_ >> /", so the final output will be the 520 URLs you wanted.

If someone knows about a text editor able to accomplish this task in an easier manner, please leave a notice. I've tried several of them but none regarding this old query, and recently had to deal with this job again - but went into this solution as this was the first idea that came to mind.
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by Stefan »

:roll: What is the main part :?:

You use an script to create 520 files to get an series of names (URLs) you need?
Then you copy the names of the items into an editor to build that what you need?

Why do you not use the code from that script and create just this names into an text file?


Code: Select all

$TextBefore = "http://www.test.com/download/";
    $StartValue = 1;
    $MaxAmount  = 520;
    $TextAfter  = "/text";
    
    $output="";
    $Count=1;

    //From 1 to $MaxAmount DO:
    while($Count<=$MaxAmount)
    {
    $Value = $StartValue -1 + $Count;

    //Auto-Pad to length of $StartValue:
    while (strlen($Value)<strlen($StartValue)){$Value = 0$Value;}

    //create new items:
    //new $InitalPath\$TextBefore$Value$TextAfter , $ItemType;

    //collect all iterations for an output:
    $output = "$output$TextBefore$Value$TextAfter<crlf>";
    incr $Count;
    }

    //Example outputs:
    text $output;
    //writefile("C:\TEMP\List.txt", $output);
    //run notepad "C:\TEMP\List.txt";


 /*
 Output will be:
 http://www.test.com/download/1/text
 http://www.test.com/download/2/text
 http://www.test.com/download/3/text
 ...
 http://www.test.com/download/520/text
 */
Or i am totally on the Holzweg :?:

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

(laughing out loud)
(for REAL)
Thanks, man. Easier than that, impossible.
XYscripters - leaving specialized tools far away behind...
(tested - it's wonderful!)
:wink:
-------------------
Added the following:

Code: Select all

//Example outputs:
    text $output;
    copytext $output;
For newcomers, this " copytext $output;" extra part will copy the text into clipboard, having it ready to paste anywhere you want.
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Can you please provide an update to that bullets and numbering code, so I could have a customizable way to to include yyyy-mm-dd in the final links? For the sake of simplicity, I don't mind the upper limit for all "dd" values being 31 (no matter which "mm" is being written), and I think it'll be easier for you adding a "lower/maximum" user input for yyyy, defaulting "0" to current year if none is specified. As an idea, you could post similar code in another section aiming to help people that needs to create folders and subfolders to sort photos out.

Code: Select all

2009
2009/11
2009/11/30
2009/11/29
2009/11/28
I know of specialized software (RoboFolder) being able to achieve that, but I think this could be interesting since you converted my original complicated method into an elegant solution. Kind of "reversing the reversal". :wink:
Thank you very much!
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by Stefan »

SkyFrontier wrote:something like

Code: Select all

http://www.test.com/tasks/2009-12-29/text
http://www.test.com/tasks/2009-12-30/text
http://www.test.com/tasks/2009-12-31/text
Understood :wink:

http://www.test.com/tasks/2009-01-01/text
...
http://www.test.com/tasks/2009-12-31/text



.

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Stefan:
Understood :wink:
Yeah! 8)
Regarding the "month-based folder creation" part of the query is solved in this thread.
Thank you, Stefan!
Also hope all of this inspires people around this forum on the possibilities provided by XYscripting! XYway of file management!
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Suggestion:
You could provide an HTML version for it, so it could be flexible enough right out of the box to create things like

Code: Select all

http://www.test.com/texts/mixed_01192010.txt
...
http://www.test.com/texts/mixed_07012010.txt
as well as

Code: Select all

http://www.test.com/tasks/2009-12-29/text
...
http://www.test.com/tasks/2009-12-31/text
limiting the range to any year/month/day as much as one likes, while allowing for addition of extensions in case of files or complete, complex structures for folders.
The Create Folders thing is a perfect example (can create files and folders, but not web links - this would be the next step!).

Wow. :D
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by Stefan »

SkyFrontier wrote:something like

Code: Select all

http://www.test.com/tasks/2009-12-29/text
http://www.test.com/tasks/2009-12-30/text
http://www.test.com/tasks/2009-12-31/text
OK, here is the hard coded first version.
I got an idea to make this more common, so the user can just
modify an example line instead of the some parts of the code,
and the script will create output based on that example line,...but... later...

Code: Select all

   //============================== the settings:
$a=0;

    $TextBefore = "http://www.test.com/tasks/";
    $TextAfter  = "/text";
    $Year=2007;


   //============================== the code:
    $YearMonth="";
    $Month=1;
    $output="";

    while($Month <=12)
   {
      while ( strlen( $Month ) < 2 ) { $Month = 0$Month; }
      
      //adjust this
      //create 12 months:  YYYY-MM  >>> $Year-$Month
      $YearMonth = $Year."-$Month";
     
      $DAY=1;
      $Line="";
      while($DAY <= 31)
      {
         while ( strlen( $DAY ) < 2 ) { $DAY = 0$DAY; }
         
         //adjust this
         //for each month create an line for each of 31 days:
         //  Text 'YYYYMM from above'-DD Text >> $TextBefore$YearMonth-$DAY$TextAfter
         $Line = $Line$TextBefore$YearMonth."-$DAY$TextAfter<crlf>";
         
      incr $DAY;
      }
      $output="$output$Line";
      incr $Month;
   }
   
   text $output;
Creates lines like:
Last edited by Stefan on 10 Aug 2010 11:30, edited 1 time in total.

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

...it just pops a two-line code segment under current mouse pointer's position... Tried to adjust some values but with the same result...
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by Stefan »

SkyFrontier wrote:...it just pops a two-line code segment under current mouse pointer's position... Tried to adjust some values but with the same result...
:wink:
I am impressed how less info you provide... what do you have seen?... which code segments?
But i can guess already what's happens:

just indent the last line with "text $output;" by one single space at least.

See:
Scritping HowTo's wrote: Common questions, mistakes and pitfalls
- - - - - - - - - - - - - - - - - -
Note that for each script only the first line starts at column position 1!
All other following line are indented by at least one space/blank.
http://88.191.26.34/XYwiki/index.php/Scripting/HowTo


me,... just going modifying the script above to add an blank...

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Stefan:
I am impressed how less info you provide...
-and I am impressed how much people are never satisfied... :D
But... just in case, I'll give you some hints:
-try to write fast in a language that's not native of yours;
-extensively testing and adapting a code you don't wrote and barely understand, but trying to NOT bother with obvious questions (despite this seems to be not your impression - but think about solutions I've found even for questions I posted here few months back, or little contributions just like this very thread itself);
-being concise (since other poster told me to do so);
-fighting the clock since you are trying to startup a company;
-always having on mind that posts have to be meaningful and helpful, with all references available;
-being responsive;
-and trying to NOT turn on another computer just to write down two small pieces of code which you can't on the source machine since alt+tab causes it to shut, and writing on paper and taking a screenshot would sound a bit too much just to illustrate that
SkyFrontier:
...it just pops a two-line code segment under current mouse pointer's position... Tried to adjust some values but with the same result...
having all of these in mind.
Please, DON'T, Stefan! You'll have to forgive me, I've tried once to be perfect and it NOT worked! :D
---
Now, what really matters:
-it works!
-I'm yet to find how to customize the thing to get

Code: Select all

http://www.test.com/texts/mixed_01192010.txt
...
http://www.test.com/texts/mixed_07012010.txt
I currently can't, right?
-Is it possible to have two or more years of interval, will this be available when you got the time to
Stefan:
I got an idea to make this more common, so the user can just
modify an example line instead of the some parts of the code,
and the script will create output based on that example line,...but... later...
?
-Regarding your idea, wouldn't it be easier to adapt the

Code: Select all

original Create Folders code
, providing an "Option 3" and "Option 4" for plain text

Code: Select all

http://www.test.com/texts/mixed_01192010.txt
...
http://www.test.com/texts/mixed_07012010.txt
and folder structure

Code: Select all

C:\www.test.com\texts\mixed_01192010
...
C:\www.test.com\texts\mixed_07012010
, respectively?
-and a HUGE thank you, after all! Each and every day I use the little scripts we've recently discussed about, and all of this is just XYpanding possibilities over here, with the side effect of saving my injured arm from repetitive movements that caused the injuries in first place, allowing me to just focus on "files management". Thank you and Don and community!
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by Stefan »

Stefan wrote: OK, here is the hard coded first version.
I got an idea to make this more common, so the user can just
modify an example line instead of some parts of the code,
and the script will create output based on that example line,...but... later...
That is what i had in mind:



just tweak the settings as you need.

$YEAR = "<date yyyy>"; ////Create an folder-set for this year
$Collect_Text = "yes"; ////collect the output for an text file?
$Create_Folders = "ye"; ////create folder in current dir? Att: use an porper Template!!!

////Templates, use only one of this
For an output like: http://www.test.com/tasks/2009-01-01/text
create an $Template like:
$Template = "http://www.test.com/tasks/$YEAR-{{MM}}-{{DD}}/text";

WARNING: IF you create folders, be sure your used $Template will be an valid path\folder name!
Or you have to click OK 372 times. (EDIT: i added code to ask you if all went fine, so you may cancel the script)

While script is working,
$YEAR is replaced by the wanted year
{{MM}} in string is replaced by months (1...12)
{{DD}} in string is replaced by days (1...31)

I hope this syntax will work for most circumstances.


Code: Select all

    ////////////////////////////////////////////////// the settings:
$curpath="<curpath>";

   $YEAR = "<date yyyy>";   ////Create an folder-set for that year
    
    $Collect_Text = "yes";   ////collect the output for an text file?
    $Create_Folders = "ye"; ////create folder in current dir? Att: use an porper Template!!!
   ////anything others then "yes" will disable this option: 
   ////e.g. "ye" or uppercase "Yes", or "NO" or just ""    
    

    ////Templates, use only one of this
    
    ////Create text:
    ////         http://www.test.com/tasks/2009-01-01/text
    $Template = "http://www.test.com/tasks/$YEAR-{{MM}}-{{DD}}/text";


    ////           http://www.test.com/texts/mixed_01192010.txt
   // $Template = "http://www.test.com/texts/mixed_{{MM}}{{DD}}$YEAR.txt";


    ////create folders:
    ////           www.test.com\texts\mixed_01192010
   //$Template = "www.test.com\texts\mixed_{{MM}}{{DD}}$YEAR";
    //////////////////////////////////////////////////


    ////Confirm settings:
    msg "Please check!!!<crlf><crlf><crlf>Collect_Text: $Collect_Text<crlf>Create_Folders: $Create_Folders<crlf>
             $Template<crlf><crlf><crlf><crlf><crlf>Sure to execute?<crlf><crlf>",1;

    ////////////////////////////////////////////////// the code, don't touch:

    $OUTPUT="";
    $Month=1;
    while( $Month <= 12 )
    {
      while ( strlen( $Month ) < 2 ) { $Month = 0$Month; }
      $MonthLINE = replace( $Template, "{{MM}}", $Month);
     
      $DAY=1;
      $DayLINE="";
      $DAYAmount=31;
      ////Here code:  if $Month==02 Then $DAYAmount==28

      while($DAY <= $DAYAmount)
      {
         while ( strlen( $DAY ) < 2 ) { $DAY = 0$DAY; }
         $DayLINE = replace($MonthLINE, "{{DD}}", $DAY);  

         ////////////////////////////////////////////////// Collect Text
         ////collect output for an text file:
         if ($Collect_Text=="yes"){
            $OUTPUT="$OUTPUT$DayLINE<crlf>";}         
         //////////////////////////////////////////////////
       
         ////////////////////////////////////////////////// Create Folders or Files
         ////create new folders:
         if ($Create_Folders=="yes"){
            new "$curpath\$DayLINE", dir;
            #485;} //refresh file list to see the new folders
         //////////////////////////////////////////////////

      ////if the template was not capable to create valid path\folders:
      if ($DEBUGday < 0){
      if(confirm("Did Template for Day $DAY worked? Do you want to continue?")==1)
      {$DEBUGday=1;}else{end(1),"Terminated by user."}};

      incr $DAY;
      }
   
   ////For testing purpose. Disable the following line by two leading // if you don't need this:
   end(confirm("Month $Month is completed. Do you want an another one?")==0);

   incr $Month;
   }   
   
   ////Finished:
   beep;
   if ($Collect_Text=="yes"){ text $OUTPUT; }
   status  "Done!";
   //msg "Done!";
HTH? :D


EDIT:
Added two parts for debugging to the code above.
That are:

Code: Select all

1.)
This prompt you one time to ask if first loop (for Day 1) went fine:

      if ($DEBUGday < 0){
      if(confirm("Did Template for Day $DAY worked? Do you want to continue?")==1)
      {$DEBUGday=1;}else{end(1),"Terminated by user."}};

2.)
This prompt you after and for every Month (even the last one) to ask if last loop went fine:

   end(confirm("Month $Month is completed. Do you want an another one?")==0);


for 2.) 
you may use this too, to be asked only once after month 1, and then never more:

   if ($DEBUGmonth < 0 ){
   if(confirm("Month $Month is completed. Do you want to continue?")==1)
   {$DEBUGmonth=1;}else{end(1),"Terminated by user."}};



If this is useful for someone please consider an donation to Donald, thanks.
Last edited by Stefan on 11 Aug 2010 08:28, edited 3 times in total.

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Terrific, Stefan!
-except by the rollercoaster feeling in the stomach when trying the "Folder Creation" part of it... :shock:
Well.
All went ok, after all.
The prompt to check configs was a nice idea, plus the ending beep. Thanks for them, too!
Out of curiosity, I've tried the following:

Code: Select all

$Template = "texts\mixed_$YEAR-{{MM}}-{{DD}}";
-WHICH WORKED! :P
Output:

Code: Select all

texts\mixed_2010-12-31
Just have to keep in mind to check "Folders? Y/N"...
Also, Try Script came just in time - all of the editing part would be a hassle without it, sure it would...
:!: Don: Is it possible to have another UDC section that could store such scripts and launch "Try Script" filled with any selected script when clicked at (say) User > Edit Script and Run?
Many thanks again, Stefan!
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

If you allow me, this is my tested and annotated final version (for the sake of safety, since this is prone to require 372 confirmations or a task-session-abrupt-kill which may leave one mad about it... :wink: )

Code: Select all

    ////////////////////////////////////////////////// the settings:
$curpath="<curpath>";

   $YEAR = "<date yyyy>";   ////Create an folder-set for that year
   
    $Collect_Text = "yes";   ////collect the output for an text file?
    $Create_Folders = "ye"; ////create folder in current dir? Att: use an porper Template!!!
   ////anything others then "yes" will disable this option:
   ////e.g. "ye" or uppercase "Yes", or "NO" or just ""   
   

    ////IMPORTANT: Templates, use only one of this by removing "//" in front of chosen $Template
   
    ////Create TEXT: REMINDER: set LINE 7 above as $Create_Folders = "ye" (anything other than YES)
    ////         http://www.test.com/tasks/2009-01-01/text
    $Template = "http://www.test.com/tasks/$YEAR-{{MM}}-{{DD}}/text";


    ////           http://www.test.com/texts/mixed_01192010.txt
    //$Template = "http://www.test.com/texts/mixed_{{MM}}{{DD}}$YEAR.txt";

    //-------------------------------SEPARATOR-------------------------------

    ////Create FOLDERS: REMINDER: set LINE 7 above as $Create_Folders = "yes"
    ////           [[[ optional: www.test.com\ ]]] texts\mixed_01192010
    //$Template = "texts\mixed_{{MM}}{{DD}}$YEAR";

    ////           texts\mixed_2010-12-31
    //$Template = "texts\mixed_$YEAR-{{MM}}-{{DD}}";
    //////////////////////////////////////////////////


    ////Debug:
    msg "Please check!!!<crlf><crlf><crlf>Collect_Text: $Collect_Text<crlf>Create_Folders: $Create_Folders<crlf>
             $Template<crlf><crlf><crlf><crlf><crlf>Sure to execute?<crlf><crlf>",1;

    ////////////////////////////////////////////////// the code, don't touch:
    $OUTPUT="";
    $Month=1;
    while( $Month <= 12 )
    {
      while ( strlen( $Month ) < 2 ) { $Month = 0$Month; }
      $MonthLINE = replace( $Template, "{{MM}}", $Month);
     
      $DAY=1;
      $DayLINE="";
      $DAYAmount=31;
      ////Here code:  if $Month==02 Then $DAYAmount==28

      while($DAY <= $DAYAmount)
      {
         while ( strlen( $DAY ) < 2 ) { $DAY = 0$DAY; }
         $DayLINE = replace($MonthLINE, "{{DD}}", $DAY); 

         ////////////////////////////////////////////////// Collect Text
         ////collect output for an text file:
         if ($Collect_Text=="yes"){
            $OUTPUT="$OUTPUT$DayLINE<crlf>";}         
         //////////////////////////////////////////////////
       
         ////////////////////////////////////////////////// Create Folders or Files
         ////create new folders:
         if ($Create_Folders=="yes"){
            new "$curpath\$DayLINE", dir;
            #485;} //refresh file list to see the new folders
         //////////////////////////////////////////////////

      incr $DAY;
      }
   incr $Month;
   }   
   
   ////Finished:
   beep;
   if ($Collect_Text=="yes"){ text $OUTPUT; copytext $OUTPUT; status Paths copied on clipboard too!
   //status  "Done!";
   //msg "Done!";
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...

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

Re: Using Script Instead of Bullets and Numbering.

Post by SkyFrontier »

Improved version for the "bullets and numbering" script.
This one deserved a step-by-step guidance/hints and tips and some sort of "post-view" of the previous steps so one can build the base link with more precision.
An example was included.
Improved the output process a bit, either.
ToDo: integration of a simple solution to get serialized days/month/year sequence, if that is required... some day I may came up with something elegant.

Code: Select all


    $clip = "<clipboard>";
    $TextBefore = input("Please enter the initial URL or another base sentence:", "Remember: each sentence MUST stop at the first numbering - split carefully!<crlf>(The input box will be cleared when clicked and displays another kind of sample.)<crlf><crlf>From the next screens onwards you will have previewing<crlf>functionality that will help you build your sequence. Check them out!<crlf><crlf>Example: for http://fictional.site.com/numberednext/33/access/ it should be<crlf>'http://fictional.site.com/numberednext/'.<crlf><crlf>Initial value from clipboard is:<crlf>$clip.", "http://www.test.com/download/", "S");
    $StartValue = input("Will it start with '1' or is it continuing any previous sequence? Please set it:", "Need leading '0's (zeroes)? Enter them too. I.e.: '0001' > '0001, 0002'; '01' > '01, 02'.<crlf>(If you want no leading zeroes, no problem. Use any other nr. if continuing a sequence.)<crlf><crlf>Example: for http://fictional.site.com/numberednext/33/access/ it should be<crlf>'01' (http://fictional.site.com/numberednext/01...33/).<crlf><crlf>So far we have:<crlf>$TextBefore.<crlf><crlf>Initial value from clipboard is:<crlf>$clip.", "01", "S");
    $MaxAmount = input("How many numbered repetitions do you need? Please set:", "This is the maximum amount of repetitions you'll need.<crlf>(Sets how many entries will be created out of base sentence + starting value.)<crlf><crlf>Example: for http://fictional.site.com/numberednext/33/access/ it should be<crlf>'33' (http://fictional.site.com/numberednext/33/).<crlf><crlf>So far we have:<crlf>$TextBefore$StartValue.<crlf><crlf>Initial value from clipboard is:<crlf>$clip.", "10", "S");
    $TextAfter = input("Any string to set after the URL/sequence? Please insert here:", "The trailing values, usually extensions. Leave blank if none is required.<crlf>(Please use the extension dots if you'll need them.)<crlf><crlf>Example: for http://fictional.site.com/numberednext/33/access/ it should be<crlf>'/access/' (http://fictional.site.com/numberednext/33/access/).<crlf><crlf>So far we have:<crlf>$TextBefore$StartValue (max. amount: $MaxAmount).<crlf><crlf>Initial value from clipboard is:<crlf>$clip.", "/text;.ext", "S");
   
    $output="";
    $Count=1;

    //From 1 to $MaxAmount DO:
    while($Count<=$MaxAmount)
    {
    $Value = $StartValue -1 + $Count;

    //Auto-Pad to length of $StartValue:
    while (strlen($Value)<strlen($StartValue)){$Value = 0$Value;}

    //create new items (not set on this version; $ItemType not defined):
    //new $InitalPath\$TextBefore$Value$TextAfter , $ItemType;

    //collect all iterations for an output:
    $output = "$output$TextBefore$Value$TextAfter<crlf>";
    incr $Count;
    }

    //Example outputs:
    copytext $output;
    status "Sequence ready on clipboard, too!";
//you may want to disable the next section.
    text ($output, , , , w);
    //writefile("C:\<curpath>\List.txt", $output);
    //run notepad "C:\<curpath>\List.txt";
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