Asger-P Software logo

 

MacroMenu, Clipboard Modifier

From This Selection in the Clipboard

MacroMenu Icon

To This in the Editor

MacroMenu Icon
In 3 Clicks

MacroMenu Icon

Clipboard Modifier is a MacroMenu Item type, there as the name suggest can modify the contents of the clipboard, when the clipboard contains text. There are more then 55 different functions you can use and they cover a vide range of functionality such as adding, deleting swapping and aligning words in each line. Trimming, numbering, sorting and breaking lines. All functions can be combined in any way you see fit, so you can clean all lines before you build them to the form you prefer. You can even take each line apart in words and apply those words to a template.
Clipboard Modifier works on a copy of the clipboard contents, so until you actually chose SaveToClipboard() or Paste() the contents of the clipboard is unmodified and if you choose one of the special paste functions you can actually paste without modifying the clipboard at all. 
This internal copy of the clipboard contents is stores in a list of lines which are not wrapped, so if you are looking at a bunch of words in a text editor you should turn of word wrap so you get a clear picture of what you are working on.

 
Purple Dot
Working with Clipboard Modifier:

Is very easy:  Write a script using the predefined functions save it in the MacroMenu. Select the text you want modified. Copy the text to the clipboard by pressing Ctrl+C or Ctrl+Insert. Click on the MacroMenu item that you want to do the job. In most cases that is all there is to it.
You can make Clipboard Modifier do the copy to clipboard part for you, by using Copy_Ctrl_C_ToClipboard()
or Copy_Ctrl_Insert_ToClipboard(), but I have in rear cases seen that the,  sending of the copy to clipboard keystrokes can be unstable, this instability might be due to the extern editor field not having the focus, but you can see more about that in SendKeyboardCombinaton().

 
Purple Dot
Functions and scripting in general:

Using the predefined functions are the only way you can make Clipboard Modifier work and there must be only one function on each line in the script, blank lines are ok. all parameter must be enclosed by the apostrophe  like this: 'value', or you can also use quotation marks like this: "value" or as the last option you can use vertical bars like this: |value|. The rule is that the one you start with must also be the one you end with.
One more thing: the apostrophe is the default and I have made it so that when you double click between two apostrophe's all the contents between them gets highlighted even if it contains spaces, this feature makes it a lot faster to change values. There are four different types of arguments / parameters to the functions and they are colored with different colors like you can see here to the right: Purple Dot
The Four types are:

Booleans:  is either 'y' or 'n'
Integers:  is numbers 0 to 9 and can be 1, 2 or 3 digits in length.
Single Character:  Is always just one character, but it can be any character.
Strings:  Can be from 0 to several hundred characters, but it can be only one line, no line breaks.

You can have as many function lines in a script as you whish, but be aware that each function works on the result from the previous function, unless you use either ReloadClipboardData() or LoadFromClipboard() in which case you get the data you have replaced with the original data or with whatever is in the clipboard at the time (which in most cases is the same).

 

Functions Alphabetic

Purple Dot
The Function List

Lets start with the function list it self, it have two sections, the first contain all the functions that do all the work, the second is the functions for handling the result save to clipboard, paste and such.

 
Purple Dot
AddEnd( 'Text' )

Adds the Text to the end of each line, Text may consist of any character. The function does not ad anything extra, so if you want space between the line and the text you add you have to provide that in the parameter you write, like this: AddEnd( ' Text' )

 
Purple Dot
AddFront( 'Text' )

Same as above it just adds the Text to the front of each line, instead of to the end.

 
Purple Dot
AlignOnSign( 'Sign Character', 'Padding Character', 'Extra Length' )
Align Example

This function can, as you can se here to the right, organize text lines so they are much more readable, by aligned them to a certain sign. In this case it is the equal sign, but it can be any sign. The example to the right is made with this line of code:   AlignOnSign( '=', ' ', '3' )
Sign Character
is set to '=', Padding Character is set to ' ' a space character and at last there is the Extra Length, which is set to '3', that gives us the extra space between the left word to the = sign.

 
Purple Dot
AlignOnWord( 'Word Number', 'Padding Character', 'Extra Length' )

This one works in the same way as the function above, it just align to a word instead of a sign and the word number can be any word number of your choice, as long as the number exist in all the lines. A valid function call on the above example could be:  AlignOnWord( '2', ' ', '3' )

 
Purple Dot
ApplyToThisTemplateBegin( 'Skip No Word Lines ?' )

This function i special in more then one way when compared to all the other functions. This function much more complex and actually consists of two functions and a template, a start function "ApplyToThisTemplateBegin()", a template part  and a closing function "ApplyToThisTemplateEnd()". In the list of functions you can only find the start function, the end function will automatically be inserted when you double click the start function and it Code Example will look like this example:

The lines that are in between the start and the end will be considered the template. The template can be from one line to several hundred lines of text.
In the template you can use some reserved words in order to get words from each line inserted into the resulting text.
These words are; 
[LINE]    Will be replaced with the whole line in the result.
[WORD1]
to [WORD9]    Will be replaced with the corresponding word in the result
[VAR1] to [VAR9]    Will be replaced with the variables you have loaded with FirstLineAreVars() if any.

Lets see an example, in this case we will make getter functions from a set of class member variables. First we see what  data will be in the clipboard:

class TItem
{
bool AutoHide;
int ItemCount;
String Name;

Then we make a script that can apply these clipboard data to a template

FirstLineAreVars()
ApplyToThisTemplateBegin( 'y' )
[WORD1] [VAR2]::get[WORD2]()
{
}
ApplyToThisTemplateEnd()

Running this script will result in the first line class TItem being put into [VAR1] and [VAR2], the second line are skipped  because we answered yes to "Skip No Word Lines" and after that the remaining lines are run one by one against the template, replacing [WORD1] with the first word in the line and [WORD2] is replaced with the second word in the line and inserting TItem instead of [VAR2], producing this result:

bool TItem::getAutoHide()
{
}

I only show the result for the first of the three lines, but I'm sure you get the picture.

 
Purple Dot
BackSlashToForwardSlash()

This function will replace every backslash \ that it finds in the clipboard data with a forward slash /

 
Purple Dot
Break_NG_ReplyLines( 'Line Length' )

If you ever used the newsgroups and a newsreader you will know that sometimes lines can be very long and therefor very difficult to read. This function can take such lines from the clipboard, remove the reply signs at the beginning of each line, then break the line at the length you want and then insert the reply sign at the beginning of each line. so you can paste them back in to your news reader again.

 
Purple Dot
BreakLines( 'Line Length', 'Auto Indent ?', 'Fixed Indent' )

If you have long lines of text and you want to hard break them, you can use this function, Line Length is the maximum length of resulting lines. If there is a line of characters with out white spaces there is longer then the Line Length, then the line will be broken at Line Length anyway. If the function can find  a white space character to the left of the Line Length the line will be broken at the white space.
See next function for a description of the last two parameters.

 
Purple Dot
BreakLinesAfter( 'Text', 'Min. Length', 'Auto Indent ?', 'Fixed Indent' )

With this one you can break lines after a certain combination of characters 'Text', this 'Text' can be a word, a end tag like in html anchors </a> or it can be just a single character like = , or something else.  'Min. Length' is the minimum length of the resulting line.  'Auto Indent' if this one is set to 'y' and the original line starts with a tab or some spaces, the same amount of spaces or tabs will be added to the start of the new line. 'Fixed Indent' is a string of spaces or tabs you want to be added to the front of every new line, this parameter can be empty, but you have to write ''.

 
Purple Dot
BreakLinesBefore( 'Text', 'Min. Length', 'Auto Indent ?', 'Fixed Indent' )

Exactly the same as above apart from one thing, this function break the line just before the 'Text' part making the new line start with the 'Text' part after after any indentation.

 
Purple Dot
Clear()

Will clear the internal list of lines, this can be useful if you want to create a special date for pasting.

 
Purple Dot
ClearClipboard()

Empty the Windows clipboard, should you ever need it.

 
Purple Dot
Copy_Ctrl_C_ToClipboard()

If you call this function it will send the keyboard combination Ctrl + C to the application that have the focus, making any selected text in that window, get copied to the clipboard.

 
Purple Dot
Copy_Ctrl_Insert_ToClipboard()

A small number of editors do not know the Ctrl + C command for copying, so if you call this function instead of the one above, it will send the keyboard combination Ctrl + Insert to the application that have the focus, making any selected text in that window, get copied to the clipboard..

 
Purple Dot
ConvertTabsTo( 'Text' )

This function can find all tab characters in a text and replace them with what ever string you want. Usually this function is used with a string of spaces as the 'Text' part like this: ConvertTabsTo( '   ' )  which will result in all tabs being replaced with three spaces.

 
Purple Dot
CurrentDateTimeInsertTop( 'Format Text' )

This function will take the current date, and format it according to the text in Format Text, then the date will be inserted as the first line in the contents of the clipboard.
You can use the following format specifiers in the Format Text:

 
 Code Result
c Inserts the date using the format given by the System Short Date setting, followed by the time using the format given by the System Long Time setting.
d Inserts the day as a number without a leading zero [1-31].
dd Inserts the day as a number with a leading zero [01-31].
ddd Inserts the day as an abbreviation [Sun-Sat] using the strings given by the System Short Day Names settings.
dddd Inserts the day as a full name [Sunday-Saturday] using the strings given by the System Long Day Names settings.
ddddd Inserts the date using the format given by the System Short Date setting.
dddddd Inserts the date using the format given by the System Long Date setting.
m Inserts the month as a number without a leading zero [1-12]. If the m specifier immediately follows an h or hh specifier, the minute is inserted instead of the month.
mm Inserts the month as a number with a leading zero [01-12]. If the mm specifier immediately follows an h or hh specifier, the minute is inserted instead of the month.
mmm Inserts the month as an abbreviation [Jan-Dec] using the strings determined by the System Short Month Names setting.
mmmm Inserts the month as a full name (January-December) using the strings given by the System Long Month Names settings.
yy Inserts the year as a two-digit number [00-99].
yyyy Inserts the year as a four-digit number [0000-9999].
h Inserts the hour without a leading zero [0-23].
hh Inserts the hour with a leading zero [00-23].
n Inserts the minute without a leading zero [00-59].
nn Inserts the minute with a leading zero [00-59].
s Inserts the second without a leading zero [00-59].
ss Inserts the second with a leading zero [00-59].
t Inserts the time using the format given by the System Short Time setting.
tt Inserts the time using the format given by the System Long Time setting.
am/pm Give you the 12-hour clock for the preceding h or hh specifier, and Inserts an 'am' for any hour before noon, and a 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is Inserted accordingly.
a/p Give you the 12-hour clock for the preceding h or hh specifier, and Inserts an 'a' for any hour before noon, and a 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is Inserted accordingly.
ampm Give you the 12-hour clock for the preceding h or hh specifier, and Inserts the system contents of the System Time-AM setting for any hour before noon, and the contents of the system Time-PM setting for any hour after noon.
/ Inserts the date separator character given by the System Date Separator setting.
: Inserts the time separator character given by the System Time Separator setting.
'xx'/"xx" Characters enclosed in single or double quotes are displayed as is, and do not affect formatting, be careful that you use the opposite of the quote you use to enclose the whole format string, look at Functions And Scripting General for details.

I have added four more readable specifiers for the four most used combinations.

shortdate is the same as 'ddddd' and give you the System Short Date without any time.
longdate is the same as 'dddddd' and give you the System Long Date without any time.
shortdatetime is the same as 'ddddd t' and give you the System Short Date + System Short Time.
longdatetime is the same as 'dddddd tt' and give you the System Long Date + System Long Time.

 

Purple Dot
CurrentDateTimeInsertBottom( 'Format Text' )

Will work in the same way as CurrentDateTimeInsertTop except that the dates is added as a new line at the bottom of the clipboard contents.

 
Purple Dot
CurrentDateTimePaste( 'Format Text' )

This function will create a Date Time string and copy the string to the clipboard followed by an automatic paste to the previous app. The Date Time string is formatted according to the Format Text following the rules given in CurrentDateTimeInsertTop.

 
Purple Dot
CurrentDateTimeType( 'Format Text' )

This function will create a Date Time string and copy the string to the clipboard followed but instead of pasting the Date Time string is send to the previous app as a series of keystrokes. The Date Time string is formatted according to the Format Text following the rules given in CurrentDateTimeInsertTop.

 
Purple Dot
DeleteFirstChar()

This function will remove the first character from from each line and it doesn't matter if its a letter , number or space it delete the first and only the first. Here is a script example where it comes in handy:

Trim()
Replace( ' *', '* ' )
SwapWords( '1', '2' )
DeleteFirstChar()
SwapWords( '1', '2' )

This little script will convert a lines like this:

   TItem *FItem; 

Into a line like this one below where the * is moved and the F is gone

TItem* Item;

 
Purple Dot
DeleteFirstWord()

Removes the first word and every separator from the beginning of each line up until the start of the second word, what is considered part of a word or part of separators is controlled  by WordSepparators.

 
Purple Dot
DeleteLastChar()

Removes the last character of each line whether it is a space, tab, letter or digit. If you want to make sure that it is actually the last visible character of the line, you are deleting, I suggest you use TrimRight() before you use DeleteLastChar().

 
Purple Dot
DeleteLastWord()

Removes the last word and every separator from the end of each line up until the end of the word that comes before the last word, what is considered part of a word or part of separators is controlled  by WordSepparators.

 
Purple Dot
EscapeCharacter( 'Escape', 'Char' )

Some characters have special meaning in programming strings and if you want them to have their normal meaning they need to be escaped. In C/C++ the backslash is such a a character so a path line like this one below will not work in C/C++.

"C:\Users\UserName\AppData\Roaming\Asger-P"

But if you use   EscapeCharacter( '\', '\' )   you will get a path string that works and look like this:

"C:\\Users\\UserName\\AppData\\Roaming\\Asger-P"

 
Purple Dot
FirstLineAreVars()

This function is used together with ApplyToThisTemplateBegin() and it takes the first line separate it into words and store those words into [VAR1] to [VAR9] or as many as there is word in the first line but max 9. These variables can then be used in your templates.

 
Purple Dot
ForwardSlashToBackSlash()

Will replace any forward slash / with a backslash \

 
Purple Dot
InsertAfterWord( 'Word Nr', 'Text' )

With this function you can insert a piece of 'Text' right after any word 'VAR Nr' in a line of text. The 'Text' part can contain any character(s) that you can write in a text editor. If it is a word you want to insert after another word and you want there to be a space between the two words you will have to add it your self like this: ' Text'.
The parameter 'Word Nr' is a number from 1 to 999

 
Purple Dot
InsertBeforeWord( 'Word Nr', 'Text' )

The same as above in InsertAfterWord(), but the 'Text' will be inserted before the word with the right number.

 
Purple Dot
InsertVAR_AfterWord( 'Word Nr', 'Text Between', 'VAR Nr' )

With this function you can insert the text of a 'VAR Nr' right after any word 'Word Nr' in a line of text. The text in the 'VAR Nr' part you get from calling FirstLineAreVars at the beginning of your script. The 'Text Between'. part can contain any character(s) that you can write in a text editor and it is put in between the word there is found as 'Word Nr' and the text that comes from 'VAR Nr'
The parameter 'Word Nr' is a number from 1 to 999

 
Purple Dot
InsertVAR_BeforeWord( 'Word Nr', 'Text Between', 'VAR Nr' )

 The same as above InsertVAR_AfterWord except in this function the 'VAR Nr' text is inserted before the 'Word Nr' text, but still with 'Text Between' put in between the two.

Example:
Lets see how this can be put to use, we put in a ClassName above a set of functions we would like to give bodies then we copy, in this case, all four lines into the clipboard:

ClassName
   void   function1();
   String function2( String s );
   int    function3( int i );

Then we make a script that can convert this ClassName and these function declarations into functions with bodies and class reference

FirstLineAreVars()
Trim()
RemoveDublicateSpaces()
DeleteLastChar()
InsertVAR_BeforeWord( '2', '::', '1' )
ApplyToThisTemplateBegin( 'y' )
[LINE]
{

}
//---------------------------------------------------------------------------
ApplyToThisTemplateEnd()
Paste()

Running this script will result in the first line ClassName is being put into [VAR1]. Then the work begin on the remaining lines, first they are trimmed for any leading and trailing white spaces, then extra spaces in between words are deleted and after that the last ; are deleted. Now we insert the ClassName + :: in front of the function name. Last we run each of the resulting lines against the template, before we paste it all into the editor at cursor position, producing this result:

void ClassName::function1()
{

}
//---------------------------------------------------------------------------

I only show the result for the first of the three lines, but I'm sure you get the picture.

 
Purple Dot
LinesEqualToLongestPadLeft( 'Padding Character', 'Extra Length' )

This function will make all the lines, contain the same number of character, as the longest line, by adding characters to the front of each line there is to short. The characters there are added will be the same as the one you write in the 'Padding Character' field. You can also chose that the lines should be longer then the longest line by putting in a number larger then 0 in 'Extra Length'.

 
Purple Dot
LinesEqualToLongestPadRight( 'Padding Character', 'Extra Length' )

The same as the function above LinesEqualToLongestPadLeft() except that the line will be padded at the end instead of at the front.

 
Purple Dot
LoadFromClipboard()

This will clear all data contained in the Clipboard Modifier's line list and list of variables. Then it will read the contents of the system clipboard into the list of lines.

 
Purple Dot
LowerCaseAll()

This function will turn any upper case letter into its lower case counterpart.

 
Purple Dot
MultilineComment( 'Start', 'End' )

This function will insert the 'Start' part at the front of the first selected line and the 'End' part at the end of the last selected line.

 
Purple Dot
NumbersLeft( 'Start Nr', 'Do Padding ?', 'Padding Character' )

This function will insert numbers at the beginning of each line. The numbers can start at any number, '1' is the most common, but '987' is just as valid as the 'Start Nr'. If you chose 'y' in the 'Do Padding ?' field the numbers will be right aligned and the padding at the left side of the number, will be the 'Padding Character' you chose, where ' ' or '0' are the most common.

 
Purple Dot
NumbersRight( 'Start Nr', 'Do Padding ?', 'Padding Character' )

This function will add numbers to the end of each line. The numbers can start at any number, '1' is the most common, but '987' is just as valid as the 'Start Nr'. If you chose 'y' in the 'Do Padding ?' field the numbers will be right aligned and the padding at the left side of the number, will be the 'Padding Character' you chose, where ' ', '0', '.' and '_' are the most common. Here is a little script example:

LinesEqualToLongestPadRight( '.', '2' )
NumbersRight( '9', 'y', '.' )
Paste()

The above script will produce this result:

eclipse.help.toc....................9
eclipse.help.base.activitySupport..10
eclipse.help.browser...............11

 
Purple Dot
Paste()

Paste is exactly like a normal Ctrl+V or Shift+Insert and because MacroMenu automatically return the keyboard focus to the previous application when performing an action, it is possible to send a Keyboard message to that application, making it do a Paste operation. When you use the Paste() function Clipboard Modifier will automatically call SaveToClipboard() just before doing the paste, so that it will be the modified data there is pasted.

 
Purple Dot
Paste Special General

Special paste is not really a paste operation, it is actually a process where the result is send as a series of keystrokes to the application that have the keyboard focus, just as if you were typing it your self, only a lot faster. Even though it is fast typing (500 strokes/second), special paste is still a lot slower then using the regular paste.
Another thing to consider when using special paste, is the cursor position and the amount of selected text. Usually there is no text selected before running a special paste and the cursor position is where you want the typing to start.

 
Purple Dot
PasteAfterLines()  (special)

When you run this function each line in the clipboard will be typed in separately and each line operation will start with an End key command so that the cursor will be positioned at the end of the line before the typing start. Each line typing will end with a Down Arrow key stroke, in order to get to the next line.

 
Purple Dot
PasteAsBlock()  (special)

This function can paste lines of different length into the middle of another text area. The way it's done is by typing the first line from current cursor position, then it send as many Left Arrow key strokes as there was characters in the line, that way it end up at the starting position, after that it it sends a Down Arrow keystroke to get to the next line. Here is a little example starting with what is in the clipboard:

1234567890
1234567
12345678901234
123

This is the text:

....................|........................................
....................|........................................
....................|........................................
....................|........................................  

And the text after running PasteAsBlock()  with the cursor positioned at the vertical char in first line

....................|1234567890........................................
....................|1234567........................................
....................|12345678901234........................................
....................|123........................................

 
Purple Dot
PasteAsLines( 'Do Home ?' )  (special)

This will type in every line from the clipboard as separate lines and end each line with an Enter keystroke to get a new line, then it will type the next line and so on. The 'Do Home' parameter is if you are using an editor with auto indent. If you are you will probably answer 'y' to that, at least if the lines you are inserting, start with space or tab characters, because if that's the case and you use the 'n' the indent will increase for every line typed.

 
Purple Dot
PasteBeforeLines()  (special)

When you run this function each line in the clipboard will be typed in separately and each line operation will start with an Home key command so that the cursor will be positioned at the start of the line before the typing start. Each line typing will end with a Down Arrow key stroke, in order to get to the next line.

 
Purple Dot
ReloadClipboardData()

When you execute a Clipboard Modifier, the first thing that happens is, that the contents of the clipboard gets copied to an internal raw buffer, this raw buffer is then read into the line list. It is this line list that gets modified by all the functions, the raw buffer is never modified in any way. When you call ReloadClipboardData() it is the raw buffer there is once again read into the line list, a fresh start so to speak.

 
Purple Dot
RemoveDublicateSpaces()

If you have some text where there appear multiple space characters after each other, then you can use this function to make sure that there is only one space character between words, If you don't know if some of the spaces are tabs, you can just call ConvertTabsTo( ' ' ) before you call RemoveDublicateSpaces().

 
Purple Dot
RemoveEmptyLines()

As the function name says, this function will remove all empty lines, but the lines have to be empty and if a line hold a space or a tab character it might look empty, but in the eyes of this function it is not empty. So to make sure all lines that look empty are removed you must call Trim() before you call RemoveEmptyLines().

 
Purple Dot
RemoveFormatting()

If you copy some text from the internet and paste it into your word processor you will often get text with different color and size then what you already have in your document, this function can remove all that formatting so only have plain text in the clipboard.

 
Purple Dot
RemoveFromToEnd( 'Text', 'and Include ?' )

This function will find the 'Text' part in each line if it is present and it will then delete the rest of the line from that point on. Whether or not the function deletes the 'Text' part as well, will be determined by the value you give to  the 'and Include ?'  'y' (yes) or 'n' (no). This function is case sensitive !

 
Purple Dot
RemoveLineBreaks()

This function will remove all line breaks from the text in the clipboard and replace them with space characters, so that all lines will be merged into one long line.

 
Purple Dot
RemoveSpaceAndTabs()

This function will by removing all space and tab characters make each line into one long word.

 
Purple Dot
RemoveTheseCharacters( 'Characters' )

By running this function you can remove several unwanted characters in one go. The function will check all characters in the clipboard data and see if they are part of the set of 'Characters' if it is it will be removed. The 'Characters' can be only one character. This function is case sensitive.

 
Purple Dot
RemoveThisFromFront( 'Text' )

If you have a bunch of lines starting with // the single line comment in C++ you can remove them by calling this function like this:  RemoveThisFromFront( '//' ). This function is case sensitive.

 
Purple Dot
RemoveUpTo( 'Text', 'and Include ?' )

This function will find the 'Text' part in each line if it is present and it will then delete from the start of the line and up to the 'Text' part. Whether or not the function deletes the 'Text' part as well, will be determined by the value you give to  the 'and Include ?'  'y' (yes) or 'n' (no). This function is case sensitive !

 
Purple Dot
Replace( 'OldStr', 'NewStr' )

This is simply a search and replace function. This function is case sensitive.

 
Purple Dot
SaveToClipboard()

Calling this function will save the data in the line list to the clipboard so you can paste it manually. If you plan on using the Paste() function there is no need to call SaveToClipboard() because that is done automatically by the Paste() function.

 
Purple Dot
SendKeyboardCombinaton( 'Macro' )

This function can be used to send a series of keystrokes to the currently active window. The 'Macro' part can be made using the Macro Composer. You might experience problems when trying to use this function, because some programs with an integrated development interface, such as Microsoft Expression web 4, does  NOT automatically give focus to the editor, when they are activated, this means that using the special paste functions as well as the two Copy..ToClipboard functions, is out of the question. Luckily most of those programs also have a keyboard shortcut that activates the editor. In the case of  Microsoft Expression web 4 this special key is F6 which means that, by calling  SendKeyboardCombinaton('\75\7g') before using any of the special paste functions or one of the two Copy..ToClipboard makes everything work as expected.
Please note: that communicating through the keyboard is, in computer terms, a very slow process, so in some cases you will have to insert a delay in your script, using Sleep( '2' ), before you let the script work on the result, but it all depends on the situation.

 
Purple Dot
Sleep( '0.1 Seconds' )

Sometimes it is necessary to put in a pause in the script, especially when dealing with keystrokes and when that is needed you can just call e.g. Sleep( '2' ) which will give you a pause that last 0.2 seconds, on my Windows 7, 3,4 gHz Sleep( '2' ) seem to be the right amount of time to wait, when for instance text is copied to the clipboard.

 
Purple Dot
Sort( 'Descending ?', 'Case Sensitive ?' )

This function will sort all the lines in the clipboard, and you can determine the direction of the result by setting  the 'Descending ?' part to either 'y' or 'n'.  You can also determine whether or not the function will distinguish between uppercase and lowercase characters, by setting 'Case Sensitive ?' to either 'y' or 'n'.

 
Purple Dot
SortOnWordAfterSign( 'Sign Character', 'Descending ?', 'Case Sensitive ?' )

In this function Clipboard Modifier will look for the first instance of the sign in 'Sign Character', after that it will find the first word after that, save that as a temporary line beginning and then do the sort. You determine the  direction of the result by setting 'Descending ?' to either 'y' or 'n' and you determine whether or not the function will distinguish between uppercase and lowercase characters, by setting 'Case Sensitive ?' to either 'y' or 'n'.

 
Purple Dot
SortOnWordBeforeSign( 'Sign Character', 'Descending ?', 'Case Sensitive ?' )

In this function Clipboard Modifier will look for the first instance of the sign in 'Sign Character', after that it will move backward and find the first word to the left of the sign, save that position as a temporary line beginning and then do the sort. You determine the  direction of the result by setting 'Descending ?' to either 'y' or 'n' and you determine whether or not the function will distinguish between uppercase and lowercase characters, by setting 'Case Sensitive ?' to either 'y' or 'n'.

 
Purple Dot
SortOnWordNr( 'Word Nr', 'Descending ?', 'Case Sensitive ?' )

This function sort lines ignoring the contents of the line up to the word you chose by setting 'Word Nr'. You determine the  direction of the result by setting 'Descending ?' to either 'y' or 'n' and you determine whether or not the function will distinguish between uppercase and lowercase characters, by setting 'Case Sensitive ?' to either 'y' or 'n'.

 
Purple Dot
SwapWords( 'Word Nr1', 'Word Nr2' )

This function can swap any two words in each line as long as both words exist, so if you have lines with words like this example:

    EdName->Text = sMame;
   EdPhone->Text = sPhone;

Then we run this script:

WordSepparators( ' &() [ ]{}\;\'<",+*.:?!=|/%~' )
SwapWords( '1', '2' )
AlignOnSign( '=', ' ', '1' )
Paste() 

and we end with this result

    sMame  = EdName->Text;
   sPhone = EdPhone->Text;

You have probably noticed that thee is three words in both lines, but because I tell Clipboard Modifier that - and > isn't part of the word separators EdName->Text will be read as one word.

 
Purple Dot
Trim()

Removes all leading and trailing spaces, hard spaces (0xA0) and control characters from all lines, make all lines start and end with a visible character.

 
Purple Dot
Trim_NG_ReplySigns( '>|' )

Remove any leading > or | along with any nonvisible characters.

 
Purple Dot
TrimLeft()

Removes all leading spaces, hard spaces (0xA0) and control characters from all lines, make all lines start with a visible character.

 
Purple Dot
TrimRight()

Removes all trailing spaces, hard spaces (0xA0) and control characters from all lines, make all lines end with a visible character.

 
Purple Dot
TrimSpecial( 'ExtraCharacters' )

Removes all leading and trailing spaces, hard spaces (0xA0) and control characters from all lines, make all lines start and end with a visible character + it will remove all the visual characters you add in 'ExtraCharacters'.

 
Purple Dot
TrimSpecialLeft( 'ExtraCharacters' )

Removes all leading spaces, hard spaces (0xA0) and control characters from all lines, make all lines start with a visible character + it will remove all the visual characters you add in 'ExtraCharacters'.

 
Purple Dot
TrimSpecialRight( 'ExtraCharacters' )

Removes all trailing spaces, hard spaces (0xA0) and control characters from all lines, make all lines end with a visible character + it will remove all the visual characters you add in 'ExtraCharacters'.

 
Purple Dot
UpperCaseAll()

This function will turn any lower case letter into its upper case counterpart.

 
Purple Dot
UpperCaseFirstCharacterInWords()

Or Capitalize As It Is Also Called, But The Fact Is That Running This Function On Some Text Will Make It Look  Just As The Text In This Paragraph.

 
Purple Dot
WordSeparators( ' &() []{}\;\'<>",-+*.:?!=|/%~' )

This function does NOT do anything to the result by it self, but it influence the behaviour several other functions, as you saw in the SwapWords() example. The characters you see in the parameter above is the default set of characters that are considered to split letters into words. In other words they are the ones that separate a long line of characters into words.
When you change these word separators, you only change them for the one Clipboard Modifier where you do it, the default word separators are loaded at the beginning of every Clipboard Modifier.
The functions that are affected by changing the word separators are:
AlignOnWord(), ApplyToThisTemplateBegin(), DeleteLastWord(), InsertAfterWord(), InsertBeforeWord() SwapWords(), UpperCaseFirstCharacterInWords() and WordsToLines( 'Remove Numbers ?' ).

 
Purple Dot
WordsToLines( 'Remove Numbers ?' )

This one take all the words in the clipboard and put each word on its own separate line, the behavior of this function can be changes by changing the WordSeparators. If you answer y to Remove Numbers ? all words made up entirely of numbers, will be removed from the result. 

 

             


Last updated: Jun-28-2022    © Copyright 2003-2022 Asger-P Software

This kind of program goes by many names: ini editor, ini edit, password generator, password organizer, password saver.