##################################################################### # SCRIPT: SS_AllSamples # # This script installs all sample scripts, provided in a release, in directory C:/Scripts. # # There are no input arguments (FVA - Forward Variable Assignment) to this script. # # This script can be stored and edited as necessary, in a text file # called SS_AllSamples.txt in directory C:/Scripts. The script can be called as # # script SS_AllSamples.txt # # ##################################################################### # Get a list of all help page titles var str title, titles, page, file, type help > $titles # Process one title at a time while ($titles <> "") do # Get the next title lex -e "1" $titles > $title # The title has a name, type and descriptiong, separated by tabs. # If the type is "Sample Script", it is a title of a sample script. # We are only interested in these titles. set $type = $title stex "[^\t^2" $type > null stex "^\t^1]" $type > null if ( $type == "Sample Script" ) do # Yes, this is a title for a sample script. Get the help page for this title. wex "1" $title > $title help $title > $page # The page contains help headers, followed by the code for the sample script. # The code for the script begins with the first #, so we will strip off everything (and excluding) the first #. stex "]^#^" $page > null # The code for this sample script is in $page. The name of the script is in $title. We will create a file # in C:/Scripts by the name $title.txt . set $file = "C:/Scripts/"+$title+".txt" # Write the file. echo $page > { echo $file } done endif done