A collection of pre-written Shared Actions

MINI LESSONS ›› Actions Editor ›› Shared Actions ›› Library ››

MINI LESSON

Is there a collection of pre-written Shared Actions that I can import into my book for use in the Action System rather than writing them myself?


Yes, the following is a list of free Shared Actions that you can import into your ToolBook file. They will function both in Native ToolBook as well as once exported to DHTML.


To use the shared actions referenced below:


  1. Click on the desired link to initiate a download of the .ZIP file. It may be necessary to Right-Click the link and choose SAVE.
  2. Once saved on your hard drive, unzip the file.
  3. You can open the Shared Action dialog within your application and choose the IMPORT button which will allow you to choose the .TBA file.
  4. Once imported into your Book as a shared action you can call the shared action from any other Action Script or other Shared Action Script within your book.


SAMPLE FILE

This sample ToolBook 11.5 file demonstrates each of these functions, and explains how to use each of them.


 

 

SHARED ACTIONS

ITEM

The ITEM shared action works much in the same way that the ITEM function in OpenScript does. It requires two parameters - the original list string, and the item number you are looking for. An optional third parameter lets you specify a one character delimiter, with a comma being used by default.


 



ITEMOFFSET

The ItemOffset shared action is the equivalent of the OpenScript function ItemOffset. It requires two parameters - the original list string, and the item string you are searching for. An optional third parameter lets you specify a one character delimiter, with a comma being used by default.


 



ITEMCOUNT

The ItemCount shared action is the equivalent of the OpenScript function ItemCount. It only requires one parameter - the list string, however you can pass a second parameter designating a one character delimiter, with a comma being used by default. It will return a value representing the number of items in your string.


 



WORD

The Word shared action is the equivalent of the OpenScript function Word. It requires two parameters - the string value and the a number representing which word you are looking for. It will return a string containing the word located.


 



TRIMSTRING

The TrimString shared action is very similar to the OpenScript function ASYM_Trim. It requires only one parameter - the string you wish to trim. It will return the same string but with leading and trailing Spaces removed.


 



RIGHTSTRING

The RightString shared action will return the last X number of characters of a string. It requires two parameters - the string and the number of characters to return.


 



REPLACESTRING

The ReplaceString shared action is the equivalent of the replaceString OpenScript function. It requires three parameters - the original string, the string you are searching for and the string you want to use as a replacement. It will return a value representing the new string.


 



REPLACECHARS

The ReplaceChars shared action is the equivalent of saying in OpenScript: chars a to b of c = d


This will allow you to replace a series of characters within a string, with a different string. It requires four parameters - the original string, the start character position, the end character position and the string to use as a replacement. It will return a value representing the new string.


 



CLEARCHARS

The ClearChars shared action is the equivalent of saying in OpenScript: clear chars a to b of c


This will allow you to clear a series of characters within a string. It requires three parameters - the original string and the start and end character positions which you wish to be cleared. It will return a value representing the new string.


 



STRINGOF

The StringOf shared action is the equivalent of the ASYM_StringOf OpenScript function. It requires two parameters - the original string, and a number representing how many times you would like it repeated. It will return a value representing the new string.


 



PROPERSTRING

The ProperString shared action will capitalize the first character of every word within your string. It requires only one parameter - the original string. It will return a value representing the new string.


 



DAYOFWEEK

The DayOfWeek shared action will convert a date into the name of the day of the week which that date falls on. It requires three parameters - the day of the month, the month [1-12], and a 4 digit year. An optional fourth parameter will allow you to specify a seven item string containing the days of the week. Unless specified the following string will be used as a default string.


"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"


This shared action requires that the ITEM shared action also be present in your book.


 



NUMBERTOROMAN

The NumberToRoman shared action is equivalent to the ASYM_NumberToRoman OpenScript function. It requires only one parameter - the number you wish converted. An optional second parameter will allow you to specify the style of the roman numeral returned.


This shared action requires that the ITEM and ItemCount shared actions also be present in your book.


 



ROMANTONUMBER

The RomanToNumber shared action is equivalent to the ASYM_RomanToNumber OpenScript function. It requires only one parameter - the roman numeral which you need converted to a number.


This shared action requires that the ITEM and ItemOffset shared actions also be present in your book.


 



KEYWORDS: 21853 P2232




Created with the Personal Edition of HelpNDoc: Free Kindle producer