msa advanced howto script build - ajtruckle/meeting-schedule-assistant-support GitHub Wiki

How to use Script Builder

Sample Scenario

Objective: To add Duty Assignments to the Workbook S-140 Legacy template.

In this tutorial you will see how to add a Duty Assignments list to an existing schedule template. What you learn can help you make more extensive schedules!

Notes IconThis How To tutorial uses the Legacy template as a worked example and is not to be treated as an exhaustive set of instructions. It does go through the fundamentals of the steps involved in using the Script Builder. Please use the Discussions area on GitHub if you need further assistance.


Step 1

  • Start the Meeting Editor by creating a new schedule or opening an existing one.
  • Select "Workbook S-140 Legacy" from the Styles list.

Select template

Step 2

Script Builder

  • Adjust the following settings:

    • Schedule Type: Default.
    • Duty History Mode: Midweek.
    • Duty assignments to include: Select the assignments that you want to include.
    • Adjust order: Change the order of the assignments if you want to.

You should now see some sample CSS / XSL code on the right-hand side.

Notes IconIn this tutorial the Report Mode is Meeting and we are only interested in the Midweek duty assignments. So we selected Midweek in the drop-down list. So go ahead and select the mode you want to use.

Step 3

  • Move the Script Builder window to one side (keep it open).
  • Right-click the schedule and select View -> CSS from the context menu and it should open the stylesheet in the built-in text editor.

Context menu > View > CSS

  • Adjust the layout so you can see both the Script Builder and Script Editor side by side:

Both editor windows side by side

  • Save the stylesheet with a new name (File > Save As File ...). Rename it by added a suffix (eg: "-Duty"):

Image

  • Select all the CSS code from the Script Builder window, then right click and select Copy (or press CTRL+A). Paste the copied CSS code into the Duty.css at the very beginning (line 1). Like this:

CSS code copied to Script Editor

  • Save the CSS file and close the Script Editor. But keep the Script Builder open.

Image

Step 4

  • Right-click the schedule and select View -> XSL from the context menu and it should open the template in the Script Editor.
  • Save the template with a new name (File > Save As File ...). Rename it by added a suffix (eg: "-Duty"):
  • Select the XSL tab in the Script Builder.

The script needs to be copied into the renamed template in several stages as detailed below.

Stage 1

As instructed "Add this to the xsl:stylesheet node right at the top". Like this:

XSL > copy first line into Duty.xsl

Stage 2

As instructed "This goes towards the top of the script, just after the xsl:output node". Like this:

XSL > Copy stage 2

Stage 3

Change the name of the linked CSS file to the new file. Do this by locating the line which has the word link:

XSL > Copy Stage 3

Stage 4

Now copy the function call line and paste where you would like the duty history displayed.

Notes IconThis How To help topic assumes you want the assignments displayed at the bottom.

XSL > Copy Stage 4

Stage 5

Copy the actual function and paste it towards the bottom of the XSL file:

XSL > Final stage

  • Save the template and close the editor.
  • Close the Script Builder.

Updating the Display

  1. Close the Script Builder.
  2. Select the new Duty template from the drop-down list.

Final example showing duty assignments

Notes IconThere is no right or wrong way to present the duty info. This How To help topic presents the assignments in a basic list to cover all needs as simply as possible but you could now re-work the script to display the information in anyway you like.


Additional Resources

Help Topics