Scripting

If you write an Applescript and save it in the Scripts folder, it will appear in the Actions menu. If you choose it from the Actions menu, the script will be performed at the current time.


It will also appear if you command click on the chart. If you choose a script by command clicking, it will be performed at the time you click.


An example of such a script is shown below.


You can use these scripts to insert lines, fluids and drugs, at a time offset in seconds from the chosen time.

You can also use them to insert defaults.

You can insert sex specific defaults, by checking the variable sex.

tell application "Monitor2"

     set theDocument to front document

     tell theDocument

          insertLine theDocument size "18" site "Forearm"

          insertFluid theDocument time -60

          

          addDrug theDocument name "Parecoxib" dose "40" time 10

          addDrug theDocument name "Midazolam" dose "3" time -1000

          addDrug theDocument name "Tropisetron" dose "2" time -990

          addDrug theDocument name "Dexamethasone" dose "4" time -990

          addDrug theDocument name "Cefazolin" dose "2000" time -985

          addDrug theDocument name "Methadone" dose "5" time -995

          setDemographicData theDocument key "Sitting" data 1

          setDemographicData theDocument key "Mask Ventilation Grade" data 1

          setDemographicData theDocument key "Supine" data 0

          setDemographicData theDocument key "Regional or Local" data 1

          

          insertDefault theDocument tab "Risks" name "GA + ISB"

          insertDefault theDocument tab "Anaesthetic" name "LMA"

          

          addProcedure theDocument time -180 type "Interscalene" default "Interscalene Block"

          

          addInfusionRate theDocument name "Noradrenaline" rate 8 time 0 concentration 40

          

          addDrug theDocument name "Propofol" dose "120" time 0 open yes eventType "Induction"

          

          if (sex = "Female") then

               addDrug theDocument name "Tropisetron" dose "2" time -1000

               setDemographicData theDocument key "Size" data "4 proseal"

          else

               setDemographicData theDocument key "Size" data "5 proseal"

               

          end if

          

     end tell

end tell