
tell application "Microsoft PowerPoint"
  activate
  if not (slide show view of slide show window 1 exists) then
    set slideshowSettings to slide show settings of active presentation

    if my numberOfMonitor() is equal to 2 then
      set show with presenter of slideshowSettings to true
      run slide show slideshowSettings
    else
      set show with presenter of slideshowSettings to false
      run slide show slideshowSettings
    end if

  else
    exit slide show slide show view of slide show window of active presentation
  end if
end tell

to currentSlide()
  tell application "Microsoft PowerPoint"
    set curSlide to 0
    set theState to (slide state of slide show view of slide show window of active presentation)

    if theState is (slide show state running) or theState is (slide show state paused) then
      set curSlide to (current show position of slide show view of slide show window of active presentation)
    else if (exists active presentation) then
      set curSlide to (slide number of slide range of selection of document window 1)
    end if

    return curSlide
  end tell
end currentSlide


to numberOfMonitor()
  tell application "System Events"
    set monitorCount to count of (every desktop)
    return monitorCount
  end tell
end numberOfMonitor